Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

com.google.firebase.messaging.zza: can't find referenced class android.graphics.drawable.AdaptiveIconDrawable

I'm trying to implement Firebase Cloud Messaging (FCM) in my application. I added following dependency in Build.gradle and tried to build a release build variant.

compile 'com.google.firebase:firebase-messaging:15.0.0'

Build.gradle

dependencies {
   compile 'com.google.firebase:firebase-core:15.0.0'
   compile 'com.google.firebase:firebase-messaging:15.0.0'
}
apply plugin: 'com.google.gms.google-services'

Once I tried to build a 'debug' variant it worked fine and Firebase messaging works without any errors. But when I try to build 'release' built varient it outputs following error.

Warning:com.google.firebase.messaging.zza: can't find referenced class android.graphics.drawable.AdaptiveIconDrawable

Can anyone help me with this. Really appreciate your comments. Thanks

like image 622
Parinda Rajapaksha Avatar asked Apr 25 '18 07:04

Parinda Rajapaksha


2 Answers

Add this progurd rule in

progurd-rules.pro

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

like image 126
Udara Seneviratne Avatar answered Nov 03 '22 21:11

Udara Seneviratne


generate the SHA key in release mode and then add it in the firebase and then again download the json file and replace it with your old one in application.

like image 1
Parvinder06 Avatar answered Nov 03 '22 22:11

Parvinder06