question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

expo-location crashes with Unable to resume activity

See original GitHub issue

Summary

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:open
  • Created a year ago
  • Reactions:13
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
jayshah123commented, Dec 13, 2022

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.

3reactions
byCedriccommented, May 10, 2022

at org.unimodules.adapters.react.permissions...

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo android standalone app crashes when ask location ...
it creates a android standalone app. and after installing that APK and try to access the same page that asks for location permissions, ......
Read more >
Detect and diagnose crashes - Android Developers
The first step to fix a crash is to identify the place where it happens. You can use the stack trace available in...
Read more >
Troubleshooting build errors and crashes - Expo Documentation
Your build will fail. The build will succeed but encounter a runtime error, for example, it crashes or hangs when you run it....
Read more >
Bug: IllegalArgumentException in onResume ... - Issue Tracker
Crash was found via Crashlytics. Can send the link if needed. The relevant log: Fatal Exception: java.lang.RuntimeException: Unable to resume activity {.
Read more >
How to debug encrypted network traffic in React Native
The first step is to open up an Android emulator from Android Studio. Next, start the Metro bundler of your Expo app. Press...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found