迁移到androidx后无法解决mutidex问题

时间:2019-01-04 11:11:32

标签: android androidx

我的应用程序具有minsdkversion 16,并且刚刚迁移到androidx。它最初开始提供multidex问题,并且在这里研究了一些建议之后, 在构建级别的defaultConfig下添加了"multiDexEnabled true"。在迁移至androidx的过程中,gradle属性采用的值为"android.enableJetifier=true android.useAndroidX=true"。现在,如果我尝试生成签名的apk,它仍然会引发multidex问题。这里的另一个建议是添加multidex lib并添加到清单中的应用程序标签中。

implementation 'com.android.support:multidex:1.0.3'
<application
        android:name="androidx.multidex.MultiDexApplication"

尝试了这些配置建议的各种组合。仍然是multidex错误。

最终gradle。

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "in.example.problem"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'com.google.android.material:material:1.1.0-alpha02'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.squareup.retrofit2:retrofit:2.5.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
    implementation 'com.intuit.sdp:sdp-android:1.0.3'
    implementation 'com.firebase:firebase-jobdispatcher:0.7.0'
    implementation 'com.google.android.gms:play-services-maps:16.0.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'androidx.multidex:multidex:2.0.0'

   }

0 个答案:

没有答案