2017-03-25 5 views
1

こんにちは、APKをビルドしようとしていますが、Androidスタジオでこの問題を取得しています。

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

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重複したエントリ:COM/Googleは/アンドロイド/ GMS/GCM/INetworkTaskCallback $ Stub.class

のGradleファイル:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "com.example.mouad.fixmyphone" 
     minSdkVersion 15 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     // Enabling multidex support. 
     multiDexEnabled true 
    } 
    dexOptions { 
     javaMaxHeapSize "4g" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
       proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    useLibrary 'org.apache.http.legacy' 

} 
android { 
    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:25.1.1' 
    compile 'com.android.support:design:25.1.1' 
    compile 'com.android.support:support-v4:25.1.1' 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.miguelcatalan:materialsearchview:1.4.0' 
    compile 'com.google.firebase:firebase-core:10.2.1' 
    compile 'com.google.firebase:firebase-messaging:10.2.1' 
    compile 'com.firebase:firebase-client-android:2.5.2' 
    compile 'com.firebase:firebase-jobdispatcher:0.5.2' 
    compile 'com.firebase:firebase-jobdispatcher-with-gcm-dep:0.5.2' 
    testCompile 'junit:junit:4.12' 
    } 
    apply plugin: 'com.google.gms.google-services' 
+0

[このポスト](http://stackoverflow.comを/ q/33717886/4112725)が役に立つかもしれない – koceeng

+0

他の人の関心を引くためにこれをアップヴォートしましょう。あなたはもっと速く答えを得ることができます。 – koceeng

答えて

0

Firebase JobDispatcherのドキュメントが一つだけこれらのを含めるように言う:

compile 'com.firebase:firebase-jobdispatcher:0.5.2' 
compile 'com.firebase:firebase-jobdispatcher-with-gcm-dep:0.5.2' 

あなたは両方を含んでいます。そのため、あなたのアプリがcom.google.android.gms:play-services-gcmへの依存性を持っていない、あなただけの、このライブラリを含める必要があります。

compile 'com.firebase:firebase-jobdispatcher:0.5.2' 

あなたの依存関係からこの行を削除します。

compile 'com.firebase:firebase-jobdispatcher-with-gcm-dep:0.5.2' 
+0

男、あなたは一日中私はこの問題を解決するために終日過ごしました。 –

+0

考慮すべきもう一つのこと:旧式のFirebase SDK、 'firebase-client-android:2.5.2'と新しいSDK、 'com.google.firebase:firebase-messaging:10.2.1'。これは今でも動作しますが、新しいSDKからlibsを引き続き追加すると、競合が発生する可能性があります。 [アップグレードガイド](https://firebase.google.com/support/guides/firebase-android)は良いリソースです。 –

+0

あなたの観察のおかげで、WICH 1が、私は削除する必要があります。 firebase-クライアントアンドロイド:2.5.2 それとも com.google.firebase:firebaseメッセージング:10.2.1 –

関連する問題