0

アンドロイドスタジオでアプリを構築する際に次のエラーが表示されるのはなぜですか?それは私のproguardのルールまたはdexguardのルールに関連していますか?エラービルド中アプリケーション:app:transformDexArchiveWithDexMergerForDebug

私はbuild.gradleファイルに "真multiDexEnabled" を追加するとき、私はエラーの下に出る:

Error:Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'. 
> com.android.build.api.transform.TransformException: 
java.nio.file.NoSuchFileException: 
D:\android\app\build\intermediates\multi-dex\debug\maindexlist.txt 

しかし、私はbuild.gradleファイルに "真multiDexEnabled" を追加するとき、私は以下の取得エラー:

Error:Execution failed for task 
':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. 
> java.lang.RuntimeException: java.lang.RuntimeException: 
com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex 

build.gradle

buildscript { 
    repositories { 
     maven { url 'https://maven.fabric.io/public' } 
     flatDir { dirs 'D:/DexGuard-8.0.17/lib' } 
    } 
    dependencies { 
     classpath 'io.fabric.tools:gradle:1.22.1' 
     classpath ':dexguard:' 
    } 
} 
apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 
apply plugin: 'dexguard' 

repositories { 
    maven { url 'https://maven.fabric.io/public' } 
} 

android { 
    compileSdkVersion 26 
    buildToolsVersion "26.0.0" 
    defaultConfig { 
     applicationId "com.c.android" 
     minSdkVersion 19 
     targetSdkVersion 26 
     multiDexEnabled true 
    } 
    buildTypes { 
     debug { 
      proguardFile 'D:/android/app/proguard-project.txt' 
      proguardFile 'dexguard-project.txt' 
     } 
     release { 
      proguardFile 'D:/android/app/proguard-project.txt' 
      proguardFile 'dexguard-project.txt' 
     } 
    } 
} 
dependencies { 
    implementation fileTree(include: ['*.jar'], dir: 'libs') 
    implementation 'com.android.support:appcompat-v7:26.1.0' 
    implementation 'com.android.support.constraint:constraint-layout:1.0.2' 
    testImplementation 'junit:junit:4.12' 
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
     exclude group: 'com.google.code.findbugs' 
    }) 
    compile 'org.greenrobot:eventbus:3.0.0' 
    compile 'com.android.support:design:26.1.0' 
    compile 'com.google.android.gms:play-services-base:11.4.2' 
    compile 'com.google.android.gms:play-services-maps:11.4.2' 
    compile 'com.google.android.gms:play-services-location:11.4.2' 
    compile 'com.google.android.gms:play-services-places:11.4.2' 
    compile 'com.android.support:support-v13:26.1.0' 
    compile 'com.android.support:support-v4:26.1.0' 
    compile 'com.android.support:cardview-v7:26.1.0' 
    compile 'com.specyci:residemenu:1.6' 
    compile 'com.basgeekball:awesome-validation:2.0' 
    compile 'com.bahmanm:persianutils_2.10:1.0' 
    compile 'com.fasterxml.jackson.core:jackson-databind:2.8.6' 
    compile 'org.springframework.android:spring-android-rest-template:2.0.0.M3' 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true 
    } 
    compile 'com.google.guava:guava:23.3-android' 
} 
+0

プロジェクト内のjarファイルの1つが古いバージョンのGoogle Playサービスを使用していたようです。 – Nawrez

+0

build.gradleファイルを表示できますか? –

+1

@Patzuこのコマンドを実行すると、依存関係ツリーを知ることができます。**// gradlew app:dependencies --configuration compile **次に、どの依存関係が重複しているかを確認します。 –

答えて

0

プロジェクトにいくつかの依存関係の問題があります。this answerのヘルプで依存関係を確認してください。どのライブラリが問題になっているのかを知ることができます。

+0

ありがとう、私にチェックさせてください。 – Patzu

関連する問題