尝试构建未签名的APK并不断收到错误任务':app:transformDexArchiveWithExternalLibsDexMergerForDebug'的执行失败

时间:2018-08-03 00:06:33

标签: android android-studio gradle apk

大家好,我在尝试构建和导出未签名的APK时遇到很多问题,因此我可以在其他手机上进行测试,但我得到的错误是

FAILURE: Build failed with an exception.


Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 

如果有人遇到了这个问题,您能给我解决方法吗?

成绩文件

apply plugin: 'something is here'
android {
compileSdkVersion 27
defaultConfig {
    applicationId "com.madcowstudiosinc.playground"
    minSdkVersion 23
    buildToolsVersion '27.0.3'
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

 }

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.firebaseui:firebase-ui-database:4.1.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.firebase:firebase-client-android:2.3.1'


testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso- 
core:3.0.2'
}

apply plugin: 'com.google.gms.google-services'

1 个答案:

答案 0 :(得分:0)

我解决了我最后提出的问题

        multiDexEnabled true

进入我的gradle,然后我修复了一些彼此不兼容的实现。所以我检查并弃用了一些实现,然后我收到了gradle Lint.lint错误的错误,我忘记了完整的错误,并且离线模式不起作用,所以我转到了gradle函数,并检查了on的离线模式摇篮。如果您尝试执行未签名的APK,则您的手机将无法安装它,而您必须生成一个已签名的APK。