expo-location crashes with Unable to resume activity
See original GitHub issueSummary
https://forums.expo.dev/t/unable-to-resume-activity/63114
I’ve decided to create this here, hoping for some kind of answer, since the expo forums are a no-go, most of the time.
The bug is surely with the expo-location module, and not with the app, since there are multiple users having the same issue, and the crash occurs thousands of times on our customer’s devices, as we have about ~50K devices with the app installed, so it affects quite a lot of people.
I’ve tried describing it into the forum thread, so I’m not sure if I should paste it here as well, but as a summary, this seems to happen when you leave the app in the background during the night, and open it in the morning, since it mostly occurs during the morning, as another developer mentioned on the forum.
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)
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
managed
What platform(s) does this occur on?
Android, iOS
SDK Version (managed workflow only)
44 and 45
Environment
This is applicable to all devices … not environment dependent
Reproducible demo
It’s hard to reproduce, but the stack traces from all the users mentioning the issue I guess should be enough.
Issue Analytics
- State:
- Created a year ago
- Reactions:13
- Comments:16 (1 by maintainers)
This is how to reproduce this issue -> request location permission -> Do not wait for dialog -> press home -> press lock screen -> Unlock the lock screen -> open app from launcher.
This indicates that you still have
react-native-unimodules
installed. This is deprecated since October 2021, see npm. You can check if you have this installed in your project somewhere with:$ yarn why react-native-unimodules
$ npm list react-native-unimodules
Please make sure that this is not within your project.