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

Failure delivering result ResultInfo{who=@android:requestPermissions #108

Open
ramakrishnanvnr opened this issue Oct 7, 2023 · 1 comment

Comments

@ramakrishnanvnr
Copy link

Describe the bug
When try to request background geo location, the app was crashed.

To Reproduce
Steps to reproduce the behavior:

  1. Create ionic capacitor app.
  2. install background geo location
  3. add code given documentation
  4. run the app on android
  5. when start background geo location. the app was crashing.

Expected behavior
it should display the geo location

Smartphone (please complete the following information):

  • Device: Redmi - Android 13

Additional context
Plugin Version : 1.2.15

FATAL EXCEPTION: main

Process: io.ionic.starter, PID: 20357
java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=28351, result=0, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {io.ionic.starter/io.ionic.starter.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.getcapacitor.PluginCall.reject(java.lang.String)' on a null object reference
at android.app.ActivityThread.deliverResults(ActivityThread.java:5452)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:5491)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:54)
at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2284)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8302)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1037)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.getcapacitor.PluginCall.reject(java.lang.String)' on a null object reference
at com.getcapacitor.Plugin.handleRequestPermissionsResult(Plugin.java:903)
at com.equimaps.capacitor_background_geolocation.BackgroundGeolocation.handleRequestPermissionsResult(BackgroundGeolocation.java:149)
at com.getcapacitor.Bridge.onRequestPermissionsResult(Bridge.java:1065)
at com.getcapacitor.BridgeActivity.onRequestPermissionsResult(BridgeActivity.java:144)
at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:8730)
at android.app.Activity.dispatchActivityResult(Activity.java:8583)
at android.app.ActivityThread.deliverResults(ActivityThread.java:5445)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:5491) 
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:54) 
at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2284) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loopOnce(Looper.java:210) 
at android.os.Looper.loop(Looper.java:299) 
at android.app.ActivityThread.main(ActivityThread.java:8302) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1037) 

@diachedelic
Copy link
Collaborator

Please try running the example app (in the example directory) with your device, and see if the same crash occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants