question

Angelru-4290 avatar image
0 Votes"
Angelru-4290 asked RobCaplan edited

Firebase excepcion

I am using this pluginhttps: //github.com/CrossGeeks/FirebasePushNotificationPlugin

in debugging mode the notifications work fine, but in release mode they do not arrive and when executing the application the first time this exception is thrown:

 "Java.Lang.RuntimeException: 'Unable to instantiate receiver com.google.firebase.iid.FirebaseInstanceIdReceiver: java.lang.InstantiationException: java.lang.Class<com.google.firebase.iid.FirebaseInstanceIdReceiver> cannot be instantiated'"


I have activated d8 and r8, can it be that r8 removes it from firebase? how can i make it work with r8?

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JarvanZhang-MSFT avatar image
0 Votes"
JarvanZhang-MSFT answered Angelru-4290 commented

Hello,​

Welcome to our Microsoft Q&A platform!

To fix this issue, try using custom proguard config file to keep the classes like below.

-dontwarn com.google.android.gms.**
-keep class com.google.android.gms.** { *; }
-keep class com.google.firebase.** { *; }

Similar issue: https://stackoverflow.com/a/58443547/11083277


Best Regards,

Jarvan Zhang



If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

if i choose neither r8 nor proguard it works too, is there no way to keep classes with r8?

0 Votes 0 ·

Any proguard.cfg rules you are currently using should continue to work with R8. You could select the R8 option and use the proguard.cfg to keep the classes.

0 Votes 0 ·

but it just lets me select r8, proguard or none right?

0 Votes 0 ·