1

When requesting location from the user, if approximate location is selected rather than exact location, the app crashes unexpectedly.

Logcat gives the error simply "permission is null".

In my manifest I am stating

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

and in my request I am simultaneously requesting both fine and course, as specified in googles guide here

const getPermission = await PermissionsAndroid.requestMultiple([
  PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
  PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION,
]);

At this point, the app will crash, and only through logcat can I see the error

02-03 12:21:46.736 15320 15395 E AndroidRuntime: java.lang.IllegalArgumentException: permission is null
  • Post the full stacktrace, not just the first line - some function is being called with a parameter that's not allowed to be null, but we need the rest of the trace to actually tell what it is – cactustictacs Feb 03 '22 at 15:46

0 Answers0