1

My (Flutter) mobile application uses Firebase messaging and it works fine in debug mode, but when I run/build it in the release mode it crashes upon receiving a message from Firebase. I suspect that onMessage.listen somehow crashes the app. It happens only on Android devices.

Is there anything that I could've missed during the Firebase project setup or within the Android app configuration?

The following error logs are produced upon receiving a message:

E/AndroidRuntime(26859): FATAL EXCEPTION: firebase-iid-executor E/AndroidRuntime(26859): Process: com.company.app, PID: 26859 E/AndroidRuntime(26859): java.lang.IllegalAccessError: Illegal class access: 'b.c.a.b.d.a' attempting to access 'b.c.a.b.b.a.c' (declaration of 'b.c.a.b.d.a' appears in base.apk) E/AndroidRuntime(26859): at b.c.a.b.d.a.<init>(Unknown Source:169) E/AndroidRuntime(26859): at b.c.a.b.d.a.<init>(:1) E/AndroidRuntime(26859): at com.google.firebase.messaging.l0.b(:1) E/AndroidRuntime(26859): at com.google.firebase.messaging.Y.e(:2) E/AndroidRuntime(26859): at com.google.firebase.messaging.m.call(:1) E/AndroidRuntime(26859): at b.c.a.b.e.F.run(Unknown Source:4) E/AndroidRuntime(26859): at com.google.firebase.messaging.n.execute(Unknown Source:0) E/AndroidRuntime(26859): at b.c.a.b.e.m.c(Unknown Source:20) E/AndroidRuntime(26859): at com.google.firebase.messaging.o.c(:1) E/AndroidRuntime(26859): at b.c.a.b.a.a.b(:1) E/AndroidRuntime(26859): at b.c.a.b.a.a.a(Unknown Source:21) E/AndroidRuntime(26859): at b.c.a.b.a.g.run(Unknown Source:10) E/AndroidRuntime(26859): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/AndroidRuntime(26859): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/AndroidRuntime(26859): at com.google.android.gms.common.util.e.b.run(Unknown Source:6) E/AndroidRuntime(26859): at java.lang.Thread.run(Thread.java:923) 
5
  • Have you change the Sha-1 and download again the json file? Have you get the Sha-1 release version? Commented Nov 2, 2021 at 16:18
  • android or ios ? Commented Nov 2, 2021 at 16:30
  • @mariofrancois I havent checked the sha 1 option i project setup, should i? Commented Nov 2, 2021 at 17:04
  • @GbengaBAyannuga its on android Commented Nov 2, 2021 at 17:04
  • the last time i face this was on ios Commented Nov 2, 2021 at 17:08

1 Answer 1

5

The problem was solved by adding code below to /android/app/build.gradle:

... buildTypes { release { ... shrinkResources false minifyEnabled false } } 

and adding code below to /android/gradle.properties:

android.enableR8=false 
Sign up to request clarification or add additional context in comments.

1 Comment

You saved me bro, for me it was only crashing on devices running android 7.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.