Migrate an existing project to AndroidX from support libraries

Jyotishgher Astrology
By -
1

Migrate an existing project to AndroidX from support libraries



AndroidX is an open-source project by Google which provides a major improvement to the original Android Support Library. AndroidX is intended to replace the Support Library. Like support library, AndroidX is shipped independently from the Android OS and provides backward-compatibility across Android releases. The re-designed package structure is to encourage smaller and more focused libraries.

From the menu bar: Refactor > Migrate to AndroidX…
4. Back up project if needed
5. Click on Do Refactor to finish the migration

Then open Preview Refactor From the bottom and Expand the pane and click DO Ref rector It will change package automatically to Android x like below

implementation fileTree(include: ['*.jar'], dir: 'libs')

//noinspection GradleCompatibleandroidTestImplementation 'androidx.test.ext:junit:1.1.1'androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.appcompat:appcompat:1.1.0'implementation 'com.google.android.material:material:1.1.0'testImplementation 'junit:junit:4.12'/*IMGE SLIDER STASRT HERE*/implementation 'com.android.support:support-v4'implementation 'com.daimajia.slider:library:1.1.5@aar'/*IMGE SLIDER END HERE*/implementation 'com.github.PhilJay:MPAndroidChart:v2.0.9'/*CARD VIEW HERE*/implementation 'androidx.cardview:cardview:1.0.0'implementation 'androidx.recyclerview:recyclerview:1.1.0'



NOW CHECK gradle properties you will find there:

org.gradle.daemon=trueorg.gradle.parallel=trueandroid.useAndroidX=trueandroid.enableJetifier=true
earlier it were by default false


Now move to app gradle and change like 
 android {
    compileSdkVersion 29    buildToolsVersion '29.0.2'
    defaultConfig {
        applicationId "com.vedicastro.jyotishghar"        minSdkVersion 21        targetSdkVersion 29
        versionCode 53        versionName "21.1.22"        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"




    }
For References You Can check the link 

Post a Comment

1Comments

  1. Lucky Club: Casino site offering live dealer games | LuckyClub
    Lucky Club is offering online casino luckyclub.live games including slots, blackjack, roulette, live dealer casino games, live dealer roulette,

    ReplyDelete
Post a Comment