6

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

Parinda Rajapaksha
  • 2,121
  • 1
  • 23
  • 34

3 Answers3

11

Add this progurd rule in

progurd-rules.pro

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

Udara Seneviratne
  • 1,683
  • 1
  • 21
  • 40
1

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.

0

This happens because of the warning comes from the progurd-rules.pro. Use -dontwarn option to ignore it.

Parinda Rajapaksha
  • 2,121
  • 1
  • 23
  • 34