在官网下载了最新的Android Studio后,我发现新建的项目全部都是引入Android X的…
我尝试在模块的build.gradle里尝试如此操作,把androidx的都注释掉,然后再导入support包的…:
// implementation 'androidx.appcompat:appcompat:1.0.2'
// implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.android.support:appcompat-v7:27.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
// androidTestImplementation 'androidx.test:runner:1.2.0'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
然而在引用ViewPager,AppCompatActivity时,依旧找不到v4和v7包,出来的提示还是androidx的…
后来我在项目的gradle.properties里发现了2行这样的代码:
android.useAndroidX=true
android.enableJetifier=true
把这2行注释掉,成功了!终于可以成功导入v4和v7包的组件,而不用看到AndroidX了…