EAS Build Background Location Permissions NullPointerException

  • Managed SDK [42,43]
  • eas-cli/0.37.0 win32-x64 node-v14.16.1

I’m developing an app on expo since SDK 38 , today i faced a problem with expo-notifications , so i had to use eas build in order to patch the module . however there is an issue with expo-location on EAS BUILD ONLY

if i call Location.requestBackgroundPermissionsAsync() ; while the app is backgrounded i get this Exception :

java.lang.RuntimeException: Unable to resume activity {com.nexus.taxiTerangaChauffeur/com.nexus.taxiTerangaChauffeur.MainActivity}: java.lang.NullPointerException at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4519) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4551) at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2112) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:7889) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) Caused by: java.lang.NullPointerException at java.util.Objects.requireNonNull(Objects.java:220) at expo.modules.location.LocationModule.handleBackgroundLocationPermissions(LocationModule.java:874) at expo.modules.location.LocationModule.lambda$requestBackgroundPermissionsAsync$3$LocationModule(LocationModule.java:216) at expo.modules.location.-$$Lambda$LocationModule$soRisceyv7rPN0v7taQGQLORMXw.onResult(Unknown Source: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) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1457) at android.app.Activity.performResume(Activity.java:8264) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4509)

this happens on SDK 42 AND 43 + EAS BUILD , works great on Expo build

SDK 42 “expo-location”: “~12.1.2”,
SDK 43 “expo-location”: “~13.0.4”,

So i think it’s an EAS Related issue .

So i’m stuck , either broken notifications with expo build , or a broken location with EAS BUILD

My code is simple , i have a socket.io event listener , when the app is backgrounded and i send a message to this listener the exception happens .

socket.on(cancelBooking, async function (passengerData) {
let { status } = await Location.requestBackgroundPermissionsAsync();

  });

try catch doesn’t seem to do anything