Unable to resume activity

  1. SDK Version: 44
  2. Android 11, 12

Unable to resume activity {com.rideswup.app/com.rideswup.app.MainActivity}: java.lang.reflect.InvocationTargetException

This literally happens to most of the OnePlus users on Android 11 and 12.

Any clue what this is about? We have a map with online scooters and when users try opening the native maps view, it crashes randomly … with this error.

Hey @swup, have you googled to see if others have reported on that java crash when running on OnePlus devices? Always a great way to start the debugging adventure.

Hi Adam, of course I did. It seems to me this is an issue within the expo location module.

expo.modules.location.LocationModule.handleForegroundLocationPermissions (LocationModule.java:839)

Another crash (99% are oneplus users) is as follows:

Exception in HostObject::get(propName:NativeUnimoduleProxy): java.lang.NullPointerException: null cannot be cast to non-null type kotlin.Any,

Since the app crashes due to native reasons, I find it hard to debug. I did try reaching for some users with OnePlus devices, had them try the app see if it crashes … they couldn’t find anything.

Since I have no Java knowledge, it’s also hard to figure out directly from expo location’s module here.

Does anyone have any Java knowledge … because this seems like an exception which might be caught, in order to prevent future crashes …

I’ve seen this thread’s answer on SO, and I’m wondering, if that’s the case, why should we prefer our app crashing instead of silently dealing with the error?

We are seeing the same error.
Also suspecting it to be related to the Location module.

We have the permission from our users to always track when app is in fore or background.

We see this error mostly in the morning. When people had the app in the background for the night. Then they reactivate and the “cannot resume activity:MainActivity” error occurs.

Its happening frequenly. Daily half of our android user base is confronted with it.

We are totally stuck on it :slightly_smiling_face: Does someone know what to do to prevent the error?

Yes, @adamjnav suggested we google the issue, as a solution.

Me, and I guess you now, will find that very useful.
It’s an issue with the SDK itself, but, I guess it’s easier to pin it on the paying customers instead of raising an internal ticket with the dev team.

I’ve stopped our EAS subscription because of this. “Priority support”.

1 Like

We have this issue too. Below is my stack trace:

Caused by java.lang.NullPointerException
       at java.util.Objects.requireNonNull(Objects.java:220)
       at expo.modules.location.LocationModule.handleForegroundLocationPermissions(LocationModule.java:839)
       at expo.modules.location.LocationModule.lambda$requestForegroundPermissionsAsync$2$LocationModule(LocationModule.java:195)
       at expo.modules.location.-$$Lambda$LocationModule$D--6Q7JrlKjA_yBo0ZZZH8hwBGk.onResult(:4)
       at org.unimodules.adapters.react.permissions.PermissionsService$createListenerWithPendingPermissionsRequest$1.onRequestPermissionsResult(PermissionsService.kt:255)
       at com.facebook.react.ReactActivityDelegate$2.invoke(ReactActivityDelegate.java:171)
       at com.facebook.react.ReactActivityDelegate.onResume(ReactActivityDelegate.java:102)
       at com.facebook.react.ReactActivity.onResume(ReactActivity.java:57)

And the device is

I don’t think anyone will help us here … this issue is occurring thousands of times now … since we offer a scooter rental solution.

But hey, on the bright side, you can still search on google, maybe it helps, as @adamjnav suggested.

Decided to open an issue on github … hopefully that helps more.