androidx迁移后,Android Studio应用程序未安装在模拟器上

时间:2019-09-15 19:58:31

标签: android android-studio migration androidx

我的依赖项是:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation 'androidx.appcompat:appcompat:1.1.0'
    testImplementation 'junit:junit:4.12'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
}

我有一个可以在Android Pie上正常运行的应用程序,它使用了较早的支持库。但是,我决定将其迁移到AndroidX以支持最新版本。我没有更改任何逻辑代码,只是允许Studio(3.5)更改导入。现在,当我对其进行测试时,它会在Pie上崩溃(即使我将目标sdk和/或编译sdk更改为28),在Android 10模拟器上也能正常运行。我错过了什么?

1 个答案:

答案 0 :(得分:0)

请确保;

  • 您的com.android.tools.build:gradle版本大于3.2.0

  • 您的gradle.properties文件具有android.useAndroidX = true

  • 您的Android Studio版本高于3.2, TargetSDK版本和compliedSDK版本为28或更高。