apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 27
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
flavorDimensions "default"
buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 21
targetSdkVersion 27
versionCode 12
multiDexEnabled true
versionName "2.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
productFlavors {
app {
applicationId "com.app.example"
}
app2 {
applicationId "com.app2.example"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/ECLIPSE_.SF'
exclude 'META-INF/ECLIPSE_.RSA'
}
}
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'
})
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.4'
compile 'com.applozic.communication.uiwidget:mobicomkitui:5.9'
compile 'com.applozic.communication.message:mobicomkit:5.9'
compile 'com.android.support:appcompat-v7:27.1.1'
compile 'com.google.firebase:firebase-core:16.0.1'
compile 'com.google.firebase:firebase-messaging:17.1.0'
compile 'com.google.android.gms:play-services-location:15.0.1'
compile 'com.google.android.gms:play-services-places:15.0.1'
compile 'com.google.firebase:firebase-crash:16.0.1'
testCompile 'junit:junit:4.12'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.cleveroad:loopbar:1.1.3'
compile 'com.roughike:bottom-bar:2.2.0'
compile 'com.github.ekimual:croperino:1.1.7'
compile 'com.squareup.picasso:picasso:2.71828'
compile 'com.uncopt:android.justified:1.0'
compile 'com.squareup.okhttp3:okhttp:3.11.0'
compile 'com.github.renaudcerrato:static-maps-api:1.0.2'
compile 'com.wang.avi:library:2.1.3'
compile 'com.squareup.retrofit2:retrofit:2.4.0'
compile 'com.daasuu:BubbleLayout:1.1.1'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.12'
compile 'com.squareup.retrofit2:converter-gson:2.4.0'
compile 'com.android.support.constraint:constraint-layout:2.0.0-alpha1'
compile 'com.nononsenseapps:filepicker:4.1.0'
compile 'com.github.Kennyc1012:BottomSheet:2.3.1'
compile 'com.android.support:design:27.1.1'
compile 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.github.bumptech.glide:glide:4.7.1'
compile 'com.daimajia.androidanimations:library:2.3@aar'
implementation 'com.facebook.fresco:fresco:1.9.0'
compile 'com.github.stfalcon:frescoimageviewer:0.5.0'
}
那是我的gradle文件,我在某些手机上崩溃了,而不是在所有手机上都崩溃了。 Google Pixel工作正常,但三星9+版本的人报告我的应用崩溃了,我检查了Firebase是否有错误,并且看到以下错误报告,但不知道如何解决。如果您遇到类似的问题,请帮助我。这又会怎样呢?
Fatal Exception: java.lang.NoSuchMethodError
No static method zzc(Landroid/content/Context;)Lcom/google/firebase/iid/zzv; in class Lcom/google/firebase/iid/zzv; or its super classes (declaration of 'com.google.firebase.iid.zzv' appears in /data/app/com.app.example-es0Dl2G-gL0904IhfDIX2w==/base.apk:classes9.dex)
com.google.firebase.messaging.FirebaseMessagingService.zzd
com.google.firebase.messaging.FirebaseMessagingService.zzd (Unknown Source:197)
com.google.firebase.iid.zzg.run (Unknown Source:26)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
com.google.android.gms.common.util.concurrent.zza.run (Unknown Source:7)
java.lang.Thread.run (Thread.java:764)
Fatal Exception: java.lang.NoSuchMethodError
No static method zzac()Lcom/google/firebase/iid/zzap; in class Lcom/google/firebase/iid/zzap; or its super classes (declaration of 'com.google.firebase.iid.zzap' appears in /data/app/com.app.example-1/base.apk:classes9.dex)
com.google.firebase.messaging.FirebaseMessagingService.zzb (Unknown Source)
com.google.firebase.iid.zzb.onStartCommand (Unknown Source)
android.app.ActivityThread.handleServiceArgs (ActivityThread.java:3688)
android.app.ActivityThread.-wrap23 (ActivityThread.java)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1410)
答案 0 :(得分:0)
尝试更新firebase-messaging
替换
compile 'com.google.firebase:firebase-messaging:17.1.0'
收件人
compile 'com.google.firebase:firebase-messaging:17.3.4'