2017-11-04 46 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