Firebase excepcion

Ángel Rubén Valdeolmos Carmona 611 Reputation points
2021-04-01T07:25:50.077+00:00

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?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,378 questions
0 comments No comments
{count} votes

Accepted answer
  1. JarvanZhang 23,966 Reputation points
    2021-04-01T09:28:43.327+00:00

    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.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.