发布React-Native Android应用:找不到com.android.support:multidex-instrumentation:27.1.1

时间:2019-02-12 11:29:50

标签: android react-native release

当我./gradlew assembleRelease我的React本机应用程序时,我得到:

* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugAndroidTestRuntimeClasspath'.
   > Could not find com.android.support:multidex-instrumentation:27.1.1.

需要做些什么才能使其正确?

我的build.graddle:

android {
    defaultConfig {
        // ...
        multiDexEnabled true // if I comment it, I run into the multidex needed error : The number of method references in a .dex file cannot exceed 64K.
    }
}
dependencies {
    // ...
    implementation 'com.android.support:multidex:1.0.3' // commenting it does not change the problem
}

1 个答案:

答案 0 :(得分:0)

如果您使用int Money,则 app / build.gradle 中将包含以下内容:

react-native-navigation

确保还排除在上述情况下给您带来问题的库。像这样:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support' && requested.name != 'multidex') {
            details.useVersion "${rootProject.ext.supportLibVersion}"
        }
    }
}