java.lang.RuntimeException: Unable to resume activity {<app>}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=34, result=-1, data=null} to activity {<app>}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.toString()' on a null object reference

cordova-dev | Dan Polivy | 2 years ago
  1. 0

    Android plugin crash on resume when activity destroyed

    cordova-dev | 2 years ago | Dan Polivy
    java.lang.RuntimeException: Unable to resume activity {<app>}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=34, result=-1, data=null} to activity {<app>}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.toString()' on a null object reference
  2. 0

    I develop with a framework using cordova for an hybrid application. I only produce the Android version for testing the application. I'm using *cordova-plugin-camera 2.2.0* to take a picture in my application. I use getPicture method to do that. I always encounter this bug by following these steps : * Take a photo * Tap the "Retry" button * Take another photo * Then validate the photo by tapping the "Ok" button OR by cancelling with the back button * ==> App stopped I try to debug with Android Studio but even with breakpoints I don't succeed. Bellow, the stack from the Java Error when validating the photo: {code} E/AndroidRuntime: FATAL EXCEPTION: main Process: my.application.appXXX.bip.mobileClient, PID: 16960 java.lang.RuntimeException: Unable to resume activity {my.application.appXXX.bip.mobileClient/my.application.appXXX.bip.mobileClient.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=34, result=-1, data=null} to activity {my.application.appXXX.bip.mobileClient/my.application.appXXX.bip.mobileClient.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.toString()' on a null object reference at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3349) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3380) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2731) at android.app.ActivityThread.access$900(ActivityThread.java:172) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5835) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183) Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=34, result=-1, data=null} to activity {my.application.appXXX.bip.mobileClient/my.application.appXXX.bip.mobileClient.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.toString()' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:3977) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3335) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3380)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2731)  at android.app.ActivityThread.access$900(ActivityThread.java:172)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:145)  at android.app.ActivityThread.main(ActivityThread.java:5835)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.toString()' on a null object reference at org.apache.cordova.camera.CameraLauncher.processResultFromCamera(CameraLauncher.java:452) at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:787) at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120) at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:353) at android.app.Activity.dispatchActivityResult(Activity.java:6475) at android.app.ActivityThread.deliverResults(ActivityThread.java:3973) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3335)  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3380)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2731)  at android.app.ActivityThread.access$900(ActivityThread.java:172)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:145)  at android.app.ActivityThread.main(ActivityThread.java:5835)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)  {code} Bellow, the stack from the Java Error when cancelling the application: {code} E/AndroidRuntime: FATAL EXCEPTION: main Process: my.application.appXXX.bip.mobileClient, PID: 22777 java.lang.RuntimeException: Unable to resume activity {my.application.appXXX.bip.mobileClient/my.application.appXXX.bip.mobileClient.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=34, result=0, data=null} to activity {my.application.appXXX.bip.mobileClient/my.application.appXXX.bip.mobileClient.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.error(java.lang.String)' on a null object reference at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3349) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3380) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2731) at android.app.ActivityThread.access$900(ActivityThread.java:172) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5835) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183) Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=34, result=0, data=null} to activity {my.application.appXXX.bip.mobileClient/my.application.appXXX.bip.mobileClient.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.error(java.lang.String)' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:3977) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3335) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3380)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2731)  at android.app.ActivityThread.access$900(ActivityThread.java:172)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:145)  at android.app.ActivityThread.main(ActivityThread.java:5835)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.error(java.lang.String)' on a null object reference at org.apache.cordova.camera.CameraLauncher.failPicture(CameraLauncher.java:1190) at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:797) at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120) at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:353) at android.app.Activity.dispatchActivityResult(Activity.java:6475) at android.app.ActivityThread.deliverResults(ActivityThread.java:3973) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3335)  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3380)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2731)  at android.app.ActivityThread.access$900(ActivityThread.java:172)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:145)  at android.app.ActivityThread.main(ActivityThread.java:5835)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)  {code}

    Apache's JIRA Issue Tracker | 6 months ago | Victor Ros
    java.lang.RuntimeException: Unable to resume activity {my.application.appXXX.bip.mobileClient/my.application.appXXX.bip.mobileClient.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=34, result=-1, data=null} to activity {my.application.appXXX.bip.mobileClient/my.application.appXXX.bip.mobileClient.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.toString()' on a null object reference
  3. 0

    "FATAL EXCEPTION: main" on success callback for camera in cordova

    Stack Overflow | 2 years ago | Vishal Singh
    java.lang.RuntimeException: Unable to resume activity {com.CameraOptionApp/com.CameraOptionApp.CameraOptionApp}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content://media/external/images/media/5027 }} to activity {com.CameraOptionApp/com.CameraOptionApp.CameraOptionApp}: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Simon Mac Donald: Change to Camera code in PhoneGap 1.9.0

    blogspot.com | 5 months ago
    java.lang.RuntimeException: Unable to resume activity {com.dansmart.geosight/com.dansmart.geosight.Geosight}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=34, result=-1, data=null} to activity {com.dansmart.geosight/com.dansmart.geosight.Geosight}: java.lang.NullPointerException
  6. 0

    Cordova android App crashes when selecting an image from camera roll in some devices

    Stack Overflow | 1 year ago | Susitha
    java.lang.RuntimeException: Unable to resume activity {com.company.myapp/com.company.myapp.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content://media/external/images/media/12659 flg=0x1 }} to activity {com.company.myapp/com.company.myapp.MainActivity}: java.lang.NullPointerException

    3 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'java.lang.String android.net.Uri.toString()' on a null object reference

      at org.apache.cordova.camera.CameraLauncher.processResultFromCamera()
    2. org.apache.cordova
      CordovaActivity.onActivityResult
      1. org.apache.cordova.camera.CameraLauncher.processResultFromCamera(CameraLauncher.java:445)
      2. org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:674)
      3. org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120)
      4. org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:321)
      4 frames
    3. Android Platform
      ActivityThread.main
      1. android.app.Activity.dispatchActivityResult(Activity.java:6475)
      2. android.app.ActivityThread.deliverResults(ActivityThread.java:3973)
      3. android.app.ActivityThread.performResumeActivity(ActivityThread.java:3335)
      4. android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3380)
      5. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2731)
      6. android.app.ActivityThread.access$900(ActivityThread.java:172)
      7. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
      8. android.os.Handler.dispatchMessage(Handler.java:102)
      9. android.os.Looper.loop(Looper.java:145)
      10. android.app.ActivityThread.main(ActivityThread.java:5835)
      10 frames
    4. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:372)
      2 frames
    5. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
      2 frames