Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Application Not Responding when the library checks permissions #2097

Closed
derrh opened this issue Jul 24, 2024 · 2 comments
Closed

Android Application Not Responding when the library checks permissions #2097

derrh opened this issue Jul 24, 2024 · 2 comments
Labels

Comments

@derrh
Copy link

derrh commented Jul 24, 2024

Your Environment

  • Plugin version: 4.16.5
  • Platform: Android
  • OS version: 12
  • Device manufacturer / model: TCL T602DL
  • React Native version (react-native -v): 0.74.3
  • Plugin config
[
  'react-native-background-geolocation',
  {
    license: '<license>',
  },
]

Expected Behavior

The app session should not have Application Not Responding errors or crashes.

Actual Behavior

We're getting reports of Application Not Responding (ANRs).

Steps to Reproduce

The issue is intermittent and we have not been able to reproduce it.

Context

From the stack trace it appears to happen when the library is checking for permissions. This permission check is happening on the main thread.

Debug logs

Logs
native: #00 pc 00085c6c  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) (BuildId: 92dcb8f8db809270471890b0f763858b)
  native: #01 pc 00232670  /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks+140) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
  native: #02 pc 0045a5e4  /apex/com.android.art/lib64/libart.so (artJniMethodEnd+336) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
  native: #03 pc 005be57c  /apex/com.android.art/lib64/libart.so (art_jni_method_end+12) (BuildId: 5b1e3dce5abfbdc410d71d256d308227)
  at android.os.BinderProxy.transactNative(Native method)
  at android.os.BinderProxy.transact(BinderProxy.java:571)
  at android.app.IActivityManager$Stub$Proxy.checkPermission(IActivityManager.java:5375)
  at android.permission.PermissionManager.checkPermissionUncached(PermissionManager.java:1243)
  at android.permission.PermissionManager.access$100(PermissionManager.java:80)
  at android.permission.PermissionManager$1.recompute(PermissionManager.java:1311)
  at android.permission.PermissionManager$1.recompute(PermissionManager.java:1308)
  at android.app.PropertyInvalidatedCache.query(PropertyInvalidatedCache.java:562)
  at android.permission.PermissionManager.checkPermission(PermissionManager.java:1317)
  at android.app.ContextImpl.checkPermission(ContextImpl.java:2119)
  at android.content.ContextWrapper.checkPermission(ContextWrapper.java:869)
  at android.content.ContextWrapper.checkPermission(ContextWrapper.java:869)
  at androidx.core.content.a.checkSelfPermission(SourceFile:42)
  at com.transistorsoft.locationmanager.util.LocationAuthorization.hasBackgroundPermission(unavailable:9)
  at com.transistorsoft.locationmanager.location.SingleLocationRequest.g(unavailable:17)
  at com.transistorsoft.locationmanager.location.TSLocationManager$a.onLocation(unavailable:26)
  at com.transistorsoft.locationmanager.location.TSLocationManager.a(SourceFile:11)
  at com.transistorsoft.locationmanager.location.TSLocationManager.a(SourceFile:1)
  at com.transistorsoft.locationmanager.location.j.onSuccess(SourceFile:1)
  at java.lang.reflect.Method.invoke(Native method)
  at com.transistorsoft.xms.g.utils.Utils.invokeImprecise(unavailable:39)
  at com.transistorsoft.xms.g.utils.Utils.invokeMethod(SourceFile:2)
  at com.transistorsoft.xms.g.utils.Utils.invokeMethod(SourceFile:1)
  at com.transistorsoft.xms.g.tasks.OnSuccessListener$1.onSuccess(unavailable:16)
  at com.google.android.gms.tasks.zzm.run(SourceFile:26)
  at android.os.Handler.handleCallback(Handler.java:938)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loopOnce(Looper.java:231)
  at android.os.Looper.loop(Looper.java:338)
  at android.app.ActivityThread.main(ActivityThread.java:8065)
  at java.lang.reflect.Method.invoke(Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:579)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Aug 24, 2024
Copy link

github-actions bot commented Sep 7, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant