首页 > 解决方案 > 任务':react-native-custom-tabs:transformDexArchiveWithExternalLibsDexMergerForDebugAndroidTest'的执行失败

问题描述

我正在尝试构建 ./grade assembleAndroidTest,结果是一个错误

FAILURE:构建失败并出现异常。

什么地方出了错:

任务“:react-native-custom-tabs:transformDexArchiveWithExternalLibsDexMergerForDebugAndroidTest”执行失败。

java.lang.RuntimeException:java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:无法合并dex

以下是我的项目 gradle 详细信息:

应用程序/build.gradle

androidTestImplementation(project(path: ":detox"))
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test:rules:1.0.1'
ext {
    supportLibVersion = "27.0.2"
    playServicesVersion = "11.8.0"
    reactNativeVersion = "0.53.3"
}

安卓/build.gradle:

ext {
    compileSdkVersion = 27
    buildToolsVersion = "27.0.2"
    targetSDKVersion = 27
    minSDKVersion = 21
}

react-native-custome-tabs/build.gradle:

android {
        compileSdkVersion 25
        buildToolsVersion "25.0.1"

        defaultConfig {
            minSdkVersion 16
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
        }
    }
    dependencies {
        compile "com.facebook.react:react-native:+"  
        compile 'com.android.support:customtabs:25.0.1'
        compile ('com.github.droibit.customtabslauncher:launcher:1.0.8') {
        exclude module: 'customtabs'
        }
        testCompile 'junit:junit:4.12'
        }

我在 build.gradle 中都收到冲突错误消息

app/build.gradle 截图 react-native-customtab/build.gradle 截图

标签: androidreact-nativegradledetox

解决方案


利用compile 'com.android.support:customtabs:23.0.1'


推荐阅读