我已經將火力地堡雲端通訊在我的Android應用程序通過這個鏈接提供以下步驟:火力地堡雲端通訊+ FirebaseInitProvider.zza(來源不明)上簽名版本
Set Up a Firebase Cloud Messaging Client App on Android
下面是我的應用程序的一部分的build.gradle:
dependencies {
compile 'com.google.android.gms:play-services-analytics:11.0.1'
compile 'com.google.firebase:firebase-messaging:11.0.1'
compile 'com.google.firebase:firebase-core:11.0.1'
}
apply plugin: 'com.google.gms.google-services'
下面是我的項目的build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我使用AndroidStudio版本2.3.3
,當我直接通過AndroidStudio設備上安裝我的應用程序,它工作正常,但是當我創建一個簽名版本,安裝並啓動它下面的堆棧跟蹤崩潰的相同的一些原因:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: xyz.myapp, PID: 8723
java.lang.NoSuchMethodError: No static method zzb(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Lcom/google/android/gms/common/internal/zzac; or its super classes (declaration of 'com.google.android.gms.common.internal.zzac' appears in /data/app/xyz.myapp-1/base.apk)
at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5852)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5444)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5383)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1541)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
我想在這個環節提出瞭解決方案:Firebase API initialization failure. (java.lang.IncompatibleClassChangeError) #24但沒有爲我工作:(
我失去了什麼在這裏?
聽起來像你錯過了一些proguard設置 –