Android production build high crash rate

SDK 35, ejected with ExpoKit.
Getting high crash rate on Android with:

java.lang.RuntimeException: 
  at host.exp.exponent.experience.BaseExperienceActivity$2.run (BaseExperienceActivity.java:196)
  at android.os.Handler.handleCallback (Handler.java:873)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7058)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:965)

Sometimes:

java.lang.RuntimeException: Expo encountered a fatal error: Unexpected end of script

or

java.lang.RuntimeException: Expo encountered a fatal error: Unexpected EOF

Any advice on how to debug?

3 Likes

This is most likely because of the GCM library mentioned in this issue: https://github.com/expo/expo/issues/4207.

Attempts at a resolution includes “upgrading” to FCM, if you are using push notifications from Expo: https://docs.expo.io/versions/v35.0.0/guides/using-fcm/.

You can also try what I’m doing, which is to simply follow the removal steps in the above guide, as we are using OneSignal for push notifications. So far, it seems like it has fixed the issue. There is also a line in app/build.gradle referencing the Gcm library, which I also removed in addition to the line in AndroidManifest.XML mentioned in the guide above.

Hope you manage to solve it.

2 Likes

Thanks for advice! Still crashes for some reason.

I’ve tried removing GCM, also removed the GCM line in app/build.gradle and published a new build, same errors.

We are also getting this error. We haven’t used GCM, we added the FCM settings on March 7.

1 Like

Hey @fredrikschweinebarth, did you have this error before adding FCM? I’ve started seeing this error after upgrading to SDK35, was on SDK30 before that with no crashes.

@andrey we had actually added FCM before ever shipping the app live, so no. (We are also not ejected, FWIW).

Also getting this exact error. SDK 35, expo kit project.

Same error on a managed expo app sdk 35.

Not a huge crash rate but still too big to be left unsolved. Any leads ? Not using any notifications at all in the app.

1 Like

My crash rate is higher than “Bad behavior threshold”. The app is probably penalized in Google Play search because of that.

Same issue here on Expo 35 managed app

I tired installing my app on 5 different Android devices and could only reproduce the crash on one model: Huawei Honor 8a - crashes on app load. The app works fine in the expo client and I’m not receiving any Sentry bug reports either.

After installing a system update on the Huawei phone it was no longer crashing and worked perfectly, however according to the logs its not just Huawei phones crashing its multiple different phone models.

No idea how to proceed with debugging or fixing this.

1 Like