Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ProGuard issue with Google Play Service and Firebase

I am getting following warnings from Proguard for firebase messaging after upgrading Google Play services and related Libraries.

  1. Play Services: 9.4.0 -> 10.2.1
  2. MixPanel: 4.9.2 -> 4.9.8
  3. Intercom: 3.0.10 -> 3.1.3

Here is proguard warnings from com.google.firebase.messaging.*

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

I'm using latest play services.

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"

Only way I could avoid these warning was by adding following proguard rule.

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

Does anybody know side affect of this? or how to fix this firebase message issue.

UPDATE # 1 App now randomly crashes with following stacktrace.

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)
like image 910
Hossain Khan Avatar asked Apr 06 '17 18:04

Hossain Khan


1 Answers

This error usually appears when you forget to update firebase dependencies.

Firebase references MUST always be the same version as google dependencies.

This runs into your error:

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'

This solves the error:

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

Hope it solves your problem

like image 68
Borja Avatar answered Oct 14 '22 20:10

Borja