2017-09-06 6 views
2

エラーBulid APK このコードのどのような問題?ファイアベース?私はきれいにして再構築しようとします。しかし、私はこのエラーがあります。 エラーAPKエラーをビルド: ':app:transformClassesWithDexForRelease'タスクの実行に失敗しました。

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: javax/inject/Inject.class

マイアプリのGradleのファイル:私は何をしている必要は

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 26 
    buildToolsVersion "26.0.1" 
    defaultConfig { 
     applicationId "myapp.over.app" 
     minSdkVersion 15 
     targetSdkVersion 26 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     vectorDrawables.useSupportLibrary = true 

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

    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES.txt' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/notice.txt' 
     exclude 'META-INF/license.txt' 
     exclude 'META-INF/dependencies.txt' 
     exclude 'META-INF/LGPL2.1' 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:26.+' 
    compile 'com.android.support:design:26.+' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.google.firebase:firebase-auth:10.0.1' 
    compile 'com.google.firebase:firebase-database:10.0.1' 
    compile 'me.anwarshahriar:calligrapher:1.0' 
    compile 'com.github.mvpotter:kladr-api-client:0.6.1' 
    compile 'com.google.firebase:firebase-storage:10.0.1' 

    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:multidex:1.0.1' 

} 









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

allprojects { 
    repositories { 
     maven { url 'https://jitpack.io' } 
    } 
} 

+0

あなたはキャッシュを無効にして再起動した後、それをきれいにして再構築しようとしましたか? –

+0

私はお試しください。 –

答えて

0

これはかつて私に起こった、問題は特に

duplicate entry: javax/inject/Inject.class

だったので、私は私の依存関係をチェックし、私は依存関係の複数の宣言を得たことがわかったので、あなたにのlibsフォルダを中に行くとそこにあるかどうかを確認しますまた、これらの1

compile fileTree(include: ['*.jar'], dir: 'libs') 

おそらくあなたの依存関係の中で宣言されたjarファイルは、あなたのlibsフォルダに既にある:

androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:26.+' 
    compile 'com.android.support:design:26.+' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.google.firebase:firebase-auth:10.0.1' 
    compile 'com.google.firebase:firebase-database:10.0.1' 
    compile 'me.anwarshahriar:calligrapher:1.0' 
    compile 'com.github.mvpotter:kladr-api-client:0.6.1' 
    compile 'com.google.firebase:firebase-storage:10.0.1' 

    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:multidex:1.0.1' 
+0

私はディレクトリlibsを含んでいません。 –

+0

あなたの 'libs'の内容は何ですか? – Orvenito

+0

私はフォルダ.idea javax_inject_1.xmlとjavax_inject_2_5_0_b32.xmlに2つのライブラリを入れることができます。たぶんそれは間違いですか?しかし、私はこのライブラリをどのように生成したのかわかりません。 –

0

Mavenの問題。 MavenをGradleに含めることはできません。

関連する問題