我正在使用火力基地通知,从今天中午开始,我收到了此错误。
错误:任务":app:transformClassesWithJarMergingForDebug"执行失败。> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/gcm/PendingCallback$1.class
Build.gradle
apply plugin: 'com.android.application'
apply from: 'config.gradle'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "********"
minSdkVersion 17
targetSdkVersion 25
useLibrary 'org.apache.http.legacy'
versionCode 1
versionName "1.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
compileOptions {
}
aaptOptions {
cruncherEnabled = false
}
buildTypes {
release {
shrinkResources true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
android.buildTypes.each { type ->
type.buildConfigField 'String', 'CHAT_SERVER_URL', ""$chatServerUrl""
}
repositories {
jcenter()
maven {
url 'http://tokbox.bintray.com/maven'
}
maven {
url 'https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/'
}
}
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 files('libs/picasso-2.5.2.jar')
compile("com.quickblox:quickblox-android-sdk-chat:2.5.1@aar") {
transitive = true
}
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.squareup.okhttp3:okhttp:3.6.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'me.himanshusoni.chatmessageview:chat-message-view:1.0.7'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.facebook.android:facebook-android-sdk:4.20.0'
compile 'at.blogc:expandabletextview:1.0.3'
compile 'com.github.aakira:expandable-layout:1.6.0@aar'
compile 'com.opentok.android:opentok-android-sdk:2.10.+'
compile 'com.google.android.gms:play-services-gcm:10.2.6'
compile 'com.google.firebase:firebase-auth:10.2.6'
// compile 'com.google.android.gms.internal.zzanb:10.2.6'
compile 'com.google.firebase:firebase-invites:10.2.6'
compile 'com.google.firebase:firebase-messaging:10.2.6'
compile 'com.google.firebase:firebase-core:10.2.6'
compile 'com.firebase:firebase-jobdispatcher:0.5.2'
compile 'com.firebaseui:firebase-ui:0.6.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.stripe:stripe-android:4.0.1'
compile 'com.parse:parse-android:1.13.0'
compile 'io.reactivex:rxjava:1.1.6'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
compile 'com.squareup.okio:okio:1.11.0'
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
compile 'com.github.bmelnychuk:atv:1.2.+'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
您必须从模块 gradle 文件中删除编译 'com.google.android.gms:play-services-gcm:10.2.6' 。
PendingCallback 是在 Firebase 和旧 GCM 中重复的类。从gradle文件中删除"com.google.android.gms:play-services-gcm:10.2.6"后,您会发现一些编译错误,这些错误依赖于"com.google.android.gms:play-services-gcm:10.2.6"。
您必须将该代码替换为新的谷歌Firebase API代码。希望对您有所帮助。