2017-04-06 93 views
6

在升級Google Play服務和相關庫後,我收到了來自Proguard的關於Firebase消息的警告。Google Play服務和Firebase發佈ProGuard問題

  1. 播放業務:9.4.0 - >10.2.1
  2. MixPanel:4.9.2 - >4.9.8
  3. 對講:3.0.10 - >3.1.3

這裏是com.google.firebase.messaging.* proguard的警告

Warning: com.google.firebase.messaging.FirebaseMessagingService: can't find referenced method 'com.google.firebase.iid.zzg zzabT()' in program class com.google.firebase.iid.zzg 
Warning: com.google.firebase.messaging.zzc: can't find referenced field 'java.lang.String zzcvH' in program class com.google.android.gms.internal.zzbxz$zza 
Warning: com.google.firebase.messaging.zzc: can't find referenced field 'java.lang.String zzcvH' in program class com.google.android.gms.internal.zzbxz$zzb 
Warning: com.google.firebase.messaging.zzc: can't find referenced field 'java.lang.String zzcvI' in program class com.google.android.gms.internal.zzbxz$zzb 
Warning: com.google.firebase.messaging.zzc: can't find referenced field 'long zzcvJ' in program class com.google.android.gms.internal.zzbxz$zzb 
Warning: com.google.firebase.messaging.zzc: can't find referenced field 'java.lang.String zzcvK' in program class com.google.android.gms.internal.zzbxz$zzb 
Warning: com.google.firebase.messaging.zzc: can't find referenced field 'int zzcvL' in program class com.google.android.gms.internal.zzbxz$zzb 
Warning: com.google.firebase.messaging.zzc: can't find referenced field 'int zzcvM' in program class com.google.android.gms.internal.zzbxz$zzb 
Warning: com.google.firebase.messaging.zzc: can't find referenced field 'java.lang.String zzcvN' in program class com.google.android.gms.internal.zzbxz$zzb 
Warning: com.google.firebase.messaging.zzc: can't find referenced field 'java.lang.String zzcvO' in program class com.google.android.gms.internal.zzbxz$zzb 
Warning: com.google.firebase.messaging.zzc: can't find referenced field 'java.lang.String zzcvR' in program class com.google.android.gms.internal.zzbxz$zzb 
Warning: com.google.firebase.messaging.zzc: can't find referenced field 'int zzcvS' in program class com.google.android.gms.internal.zzbxz$zzb 
Warning: com.google.firebase.messaging.zzc: can't find referenced field 'com.google.android.gms.internal.zzbxz$zza[] zzcvT' in program class com.google.android.gms.internal.zzbxz$zzb 

我正在使用最新的播放服務。

intercomLibraryVersion = '3.1.3' // https://github.com/intercom/intercom-android/blob/master/CHANGELOG.md 
mixPanelVersion = '4.9.8' // https://github.com/mixpanel/mixpanel-android/releases 
playServiceVersion = '10.2.1' // https://developers.google.com/android/guides/releases 

// Google Play Services 
// https://developers.google.com/android/guides/setup 
// https://firebase.google.com/docs/android/setup 
compile "com.google.android.gms:play-services-base:$rootProject.playServiceVersion" 
compile "com.google.android.gms:play-services-gcm:$rootProject.playServiceVersion"// used by - mixpanel & intercom 

// Mixpanel 
//https://github.com/mixpanel/mixpanel-android/releases 
compile "com.mixpanel.android:mixpanel-android:$rootProject.mixPanelVersion" 

// Intercom - live chat and analytics 
// https://github.com/intercom/intercom-android 
// https://developers.intercom.com/docs/android-installation 
compile "io.intercom.android:intercom-sdk-base:$rootProject.intercomLibraryVersion" 
compile "io.intercom.android:intercom-sdk-fcm:$rootProject.intercomLibraryVersion" 

唯一的方法,我可以避免這些警告是通過添加以下proguard規則。

-dontwarn com.google.firebase.messaging.** 

有沒有人知道副作用?或者如何解決這個Firebase消息問題。

更新#1 應用程序現在隨機崩潰與下面的堆棧跟蹤。

04-06 14:49:28.911 25362-25455/? E/AndroidRuntime: FATAL EXCEPTION: pool-13-thread-1 
    Process: com.myapp, PID: 25362 
    java.lang.AbstractMethodError: abstract method "void com.google.firebase.iid.b.handleIntent(android.content.Intent)" 
    at com.google.firebase.iid.b$1.run(Unknown Source) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
    at java.lang.Thread.run(Thread.java:818) 
+0

現在,我已經降級的所有版本以前的工作人提到以上。 –

+0

同樣的問題出現在谷歌播放服務10.2.6,當試圖用我的app – JafarAlali92

+0

@ JafarAlali92對應用程序監控進行監控時,我只是好奇,下面的解決方案適合您嗎? –

回答

20

當您忘記更新Firebase依賴項時,通常會出現此錯誤。

Firebase引用必須始終與Google依賴關係相同。

這將運行到您的錯誤:

compile 'com.google.android.gms:play-services-gcm:10.2.1' 
compile 'com.google.android.gms:play-services-maps:10.2.1' 
compile 'com.google.android.gms:play-services-location:10.2.1' 

compile 'com.google.firebase:firebase-auth:10.0.1' 
compile 'com.google.firebase:firebase-core:10.0.1' 
compile 'com.google.firebase:firebase-database:10.0.1' 

這解決了錯誤:

compile 'com.google.android.gms:play-services-gcm:10.2.1' 
compile 'com.google.android.gms:play-services-maps:10.2.1' 
compile 'com.google.android.gms:play-services-location:10.2.1' 

compile 'com.google.firebase:firebase-auth:10.2.1' //Updated 
compile 'com.google.firebase:firebase-core:10.2.1' //Updated 
compile 'com.google.firebase:firebase-database:10.2.1' //Updated 

希望能解決你的問題

+0

目前我不包含firebase,但可能是第三方庫。將再次檢查'gradle依賴關係'來弄清楚,謝謝指針。 –

+0

@HossainKhan我的答案解決了你的問題? – Borja

+0

我還沒有嘗試再次升級庫。我看到了大約7個人的提議,所以我猜測你的解決方案適用於少數人。我會盡快再試一次,並在此提供我的更新。 –