2017-11-04 84 views
2

更新我的项目3摇篮和产生这个错误无法合并敏捷的Android 3.0工作室更新后

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. 

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

在另一个问题,说“有库传递性依赖”,但我不同意这种传递依赖找到库

的gradle中2.3不显示此错误

的build.gradle应用 应用插件: 'com.android.application'

android { 
    compileSdkVersion 26 
    buildToolsVersion '26.0.2' 
    compileOptions.encoding = 'UTF-8' 
    useLibrary 'org.apache.http.legacy' 
    defaultConfig { 
     applicationId "com.my.my" 
     minSdkVersion 17 
     targetSdkVersion 26 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    sourceSets { 
     main { 
      jni.srcDirs = ["libs"] 
     } 
    } 
    packagingOptions { 
     packagingOptions { 
      exclude 'META-INF/LICENSE.txt' 
      exclude 'META-INF/NOTICE.txt' 
     } 
    } 

} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile project(':dd-plist') 
    compile project(':Emojicon') 
    compile project(':CameraModule') 
    compile project(':ScapeUtils') 
    compile project(':circleimageview') 
    compile project(':FFMPG') 
    compile project(':PdfViewer') 
    compile project(':LibLinphone') 
    compile 'com.loopj.android:android-async-http:1.4.9' 
    compile 'com.github.bumptech.glide:glide:3.6.0' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.github.ornolfr:rating-view:[email protected]' 
    compile 'cat.ereza:customactivityoncrash:1.5.0' 
    compile 'com.writingminds:FFmpegAndroid:0.3.2' 
    compile 'com.google.firebase:firebase-messaging:11.0.4' 
    compile "com.android.support:appcompat-v7:26.1.0" 
    compile 'com.android.support:recyclerview-v7:26.1.0' 
    compile 'com.android.support:design:26.1.0' 
    compile 'com.google.android.gms:play-services:11.0.4' 
    compile 'org.apache.commons:commons-io:1.3.2' 
} 

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

的build.gradle项目

buildscript { 
repositories { 
    jcenter() 

    google() 
} 
dependencies { 
    classpath 'com.android.tools.build:gradle:3.0.0' 
    classpath 'com.google.gms:google-services:3.0.0' 
} 
+0

看到这个https://stackoverflow.com/问题/ 46267621 /无法合并dex –

+0

我更新播放服务和firebase,但错误未解决 – JuveNCX

+0

好了,然后,在您的应用程序中添加multiDex支持 –

回答

0

我也与这个或类似的问题作斗争。我已经设置为手动使用旧的gradle版本。从文件/项目结构/ projet我已经把gradle版本3.4.1和插件版本2.3.3 我也添加multiDexEnabled真正的应用程序/ build.gradle里面defaultConfig Hth