以下は追加後に表示されるエラーですFirebase、Googleサービスをgradleで、google-services.jsonをappモジュールに追加しました。com.android.build.api.transform.TransformException:java.util.zip.ZipException:重複したエントリ:com/google/android/gms/common/api/zza.class
私のアプリには13個のモジュールがあります。私はすべてのモジュールに7つのビルドバリアントを持っています。私は、アプリケーションモジュールにgoogle-services.jsonを配置し、それをアプリケーションモジュール内のバリアントフォルダに配置することで試しました。同じエラーが発生しています。私は一つのビルドバリアントに通知機能を持っています。
gradleとgoogle-services.jsonのfirebase関連のコードをアプリケーションから削除しましたが、完全に動作しています。
セキュリティ上の理由から、ファイル全体を共有することはできません。
メインアプリモジュールのGradle:アプリケーションのGradleで
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
compile('com.crashlytics.sdk.android:crashlytics:[email protected]') {
transitive = true;
}
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.jakewharton:butterknife:8.2.1'
apt 'com.jakewharton:butterknife-compiler:8.2.1'
compile 'com.github.hotchemi:permissionsdispatcher:2.0.7'
apt 'com.github.hotchemi:permissionsdispatcher-processor:2.0.7'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.android.support:multidex:1.0.1'
}
:
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:3.0.0'
}
:アプリ:transformClassesWithJarMergingForSmePreDebugは FAILUREをFAILED:例外で失敗しましたビルドします。
* What went wrong: Execution failed for task ':app:transformClassesWithJarMergingForSmePreDebug'.>
com.android.build.api.transform.TransformException: java.util.zip.ZipException:エントリを複製: COM /グーグル/アンドロイド/ GMS /共通/ API/zza.class
この問題では、StackOverflowで多くのリンクを使用しました。誰も私の問題を解決しなかった。任意の提案が高く評価されました。
編集プッシュ通知モジュールのGradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
//compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'com.google.firebase:firebase-messaging:9.8.0'
//compile ('com.google.firebase:firebase-messaging:9.8.0') {
//exclude group: 'com.google.android.gms'
//}
}
apply plugin: 'com.google.gms.google-services'
私はすでにこの解決策をチェックしていましたが、うまく機能しませんでした。もう一度私はあなたを確認し、更新します。 –
除外グループ方法は私にとってはうまくいきませんでした。しかし、あなたは最後のものを試しましたか?パーティーを更新するか、競合ライブラリのバージョンを強制しますか?これは私の問題を修正しました。 – Shumin
私の質問を編集しました。私はあなたのことを試して、私のために働いていません。これは私がプロジェクトで使用しているgradleの依存関係です。私はしようとすると、バージョンの競合をgradleで見つけることができませんでした。見つけてもらえますか? –