SDK 20: Stand-alone Android build hangs on loading screen

Summary

Ok, so I had a functioning pre-release on SDK19, built through exp build:android. Then I upgraded to SDK 20 today and while the app functions just fine in the Expo client. It just hangs on the loading screen on Android.

I’ve reproduced the problem on Android 7 (Nokia 3) and Android 5 (Huawai smth)

Work fine on iOS

Enter adb logcat

There are so many errors and warning on a fresh Android device, that I don’t know where to start.

  • Runtime exception in RNObject: java.lang.NullPointerException: Attempt to invoke virtual method ‘java.lang.reflect.Method java.lang.Class.getMethods()’ on a null object reference
  • AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
    08-03 09:01:49.491 26494 3658 E AndroidRuntime: Process: host.exp.exponent, PID: 26494
    08-03 09:01:49.491 26494 3658 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 36817400 byte allocation with 4190288 free bytes and 32MB until OOM
  • AndroidRuntime: FATAL EXCEPTION: main
    08-01 13:49:28.227 4080 4080 E AndroidRuntime: Process: host.exp.exponent, PID: 4080
    08-01 13:49:28.227 4080 4080 E AndroidRuntime: abi19_0_0.com.facebook.react.uimanager.IllegalViewOperationException: ViewManager for tag 48 could not be found
  • AndroidRuntime: FATAL EXCEPTION: IntentService[RegistrationIntentService]
    07-31 10:33:51.197 6451 6517 E AndroidRuntime: Process: dk.parkpark.app, PID: 6451
    07-31 10:33:51.197 6451 6517 E AndroidRuntime: java.lang.SecurityException: Not allowed to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (has extras) } without permission com.google.android.c2dm.permission.RECEIVE

Let me just address the permission-denied first. This permission is listed, and has always been in my app.json.

Can anyone narrow this down a bit for me?

1 Like

Can you send the entire logcat output and the apk?

I sent it last week via message.

A quick update. The issue seems to be with AppLoading not going away when the Redux store is ready (and state.store is no longer null).

I already have a bunch of async stuff in place for the initialization of the app, so the hooks in AppLoading are not useful to me. It would only mean more Expo specific app logic.

Again: This is only an issue on stand-alone Android. Not in Expo Client (on either iOS or Android) and not in stand-alone iOS.

Anyway… If anyone else is experiencing that the loading screen on Android never goes away, try replacing the Expo.AppLoading with a View and see what happens.

I might occasionally experience the same bug.

Could you be a bit more specific about the “loading screen” - is it the blue Expo spinner or is it your own loading screen defined in app.json you see?

What I see is the blue Expo spinner that just keeps spinning forever. It’s very hard to debug as it, so fa, only occurs in apps deployed on Android 6.0.1 (haven’t tested widely on Android though. I’m suspecting it’s AppLoading that’s somehow gets stuck but I haven’t been able to verify so far.

I’m considering to implement a timer so the app will reload (Expo.util.reload()) after a certain amount of time have passed, but I’m not sure the app even have come that far as processing AppLoading when it gets stuck at the Expo spinner so I’m not sure if the fix will have any effect.

Edit:
Expo 22.x.x

I was using <AppLoading /> from the Expo package internally. So at first glance, it appeared like the app was stuck in Expo-land. But as soon as I replaced the AppLoading component with a simple View, the problem went away.

I haven’t tried this in a while and am currently using a temporary loading screen. This was also Android 6, as far as I remember.

Alight, thanks for replying.

Det var så lidt :slight_smile:

1 Like

We found a loading issue that only affects Android shell apps. We’re pushing a fix for it in SDK 23 so hopefully that resolves these issues.

1 Like