Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-9189

java.lang.NullPointerException on select from library

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.0.1
    • Fix Version/s: None
    • Component/s: Plugin Camera
    • Labels:
    • Environment:

      Android.

      Description

      I'm getting multiple crash reports via google play. I'm unable to replicate myself but I think it could be related to CyanogenMod.

      Android 5.0 (LG Leon 4G LTE (c50))

      java.lang.RuntimeException: Unable to resume activity {com.minds.mobile/com.minds.mobile.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content://com.google.android.apps.photos.contentprovider/0/1/https://lh3.googleusercontent.com/xZgV-3YvXmuR6W7uEAJOLuHHSI0nrkzZTGESgcggVi_ovpv8qkc=s0-d/ACTUAL flg=0x1 (has clip) }} to activity {com.minds.mobile/com.minds.mobile.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.success(java.lang.String)' on a null object reference
      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3040)
      at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3071)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2410)
      at android.app.ActivityThread.access$800(ActivityThread.java:155)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:135)
      at android.app.ActivityThread.main(ActivityThread.java:5376)
      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:908)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
      Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content://com.google.android.apps.photos.contentprovider/0/1/https://lh3.googleusercontent.com/xZgV-3YvXmuR6W7uEAJOLuHHSI0nrkzZTGESgcggVi_ovpv8qkc=s0-d/ACTUAL flg=0x1 (has clip) }} to activity {com.minds.mobile/com.minds.mobile.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.success(java.lang.String)' on a null object reference
      at android.app.ActivityThread.deliverResults(ActivityThread.java:3645)
      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3026)
      ... 11 more
      Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.success(java.lang.String)' on a null object reference
      at org.apache.cordova.camera.CameraLauncher.processResultFromGallery(CameraLauncher.java:613)
      at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:695)
      at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120)
      at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:321)
      at android.app.Activity.dispatchActivityResult(Activity.java:6223)
      at android.app.ActivityThread.deliverResults(ActivityThread.java:3641)
      ... 12 more
      

      Android 4.4 (Moto G)

      java.lang.RuntimeException: Unable to resume activity {com.minds.mobile/com.minds.mobile.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content://media/external/images/media/31135 flg=0x1 }} to activity {com.minds.mobile/com.minds.mobile.MainActivity}: java.lang.NullPointerException
      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2812)
      at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2845)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2262)
      at android.app.ActivityThread.access$800(ActivityThread.java:139)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:136)
      at android.app.ActivityThread.main(ActivityThread.java:5086)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:515)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
      at dalvik.system.NativeStart.main(Native Method)
      Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content://media/external/images/media/31135 flg=0x1 }} to activity {com.minds.mobile/com.minds.mobile.MainActivity}: java.lang.NullPointerException
      at android.app.ActivityThread.deliverResults(ActivityThread.java:3432)
      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2788)
      ... 12 more
      Caused by: java.lang.NullPointerException
      at org.apache.cordova.camera.CameraLauncher.processResultFromGallery(CameraLauncher.java:613)
      at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:695)
      at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120)
      at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:321)
      at android.app.Activity.dispatchActivityResult(Activity.java:5446)
      at android.app.ActivityThread.deliverResults(ActivityThread.java:3428)
      ... 13 more
      

      Android 5.0 (HTC One)

      java.lang.RuntimeException: Unable to resume activity {com.minds.mobile/com.minds.mobile.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content: flg=0x1 }} to activity {com.minds.mobile/com.minds.mobile.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.success(java.lang.String)' on a null object reference
      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3224)
      at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3257)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2479)
      at android.app.ActivityThread.access$800(ActivityThread.java:144)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1359)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:155)
      at android.app.ActivityThread.main(ActivityThread.java:5696)
      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:1028)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
      Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content: flg=0x1 }} to activity {com.minds.mobile/com.minds.mobile.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.success(java.lang.String)' on a null object reference
      at android.app.ActivityThread.deliverResults(ActivityThread.java:3881)
      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3197)
      ... 11 more
      Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.success(java.lang.String)' on a null object reference
      at org.apache.cordova.camera.CameraLauncher.processResultFromGallery(CameraLauncher.java:613)
      at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:695)
      at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120)
      at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:321)
      at android.app.Activity.dispatchActivityResult(Activity.java:6160)
      at android.app.ActivityThread.deliverResults(ActivityThread.java:3877)
      ... 12 more
      

      Android 5.1 (OnePlus One) - Cyanogen

       java.lang.RuntimeException: Unable to resume activity {com.minds.mobile/com.minds.mobile.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content://com.android.providers.media.documents/document/image:32282 flg=0x1 }} to activity {com.minds.mobile/com.minds.mobile.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.success(java.lang.String)' on a null object reference
      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3017)
      at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3048)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2423)
      at android.app.ActivityThread.access$900(ActivityThread.java:154)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:135)
      at android.app.ActivityThread.main(ActivityThread.java:5293)
      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:904)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
      Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content://com.android.providers.media.documents/document/image:32282 flg=0x1 }} to activity {com.minds.mobile/com.minds.mobile.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.success(java.lang.String)' on a null object reference
      at android.app.ActivityThread.deliverResults(ActivityThread.java:3605)
      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3003)
      ... 11 more
      Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.success(java.lang.String)' on a null object reference
      at org.apache.cordova.camera.CameraLauncher.processResultFromGallery(CameraLauncher.java:613)
      at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:695)
      at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120)
      at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:321)
      at android.app.Activity.dispatchActivityResult(Activity.java:6192)
      at android.app.ActivityThread.deliverResults(ActivityThread.java:3601)
      ... 12 more
      

        Issue Links

          Activity

          Hide
          joaop.grassi Joao Grassi added a comment -

          I'm getting it too. Android 4.4 (Moto G (titan_umtsds))

          java.lang.RuntimeException: Unable to resume activity

          {com.grassi.manezinhoevoce/com.grassi.manezinhoevoce.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=0, data=null} to activity {com.grassi.manezinhoevoce/com.grassi.manezinhoevoce.MainActivity}

          : java.lang.NullPointerException
          at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2812)
          at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2845)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2262)
          at android.app.ActivityThread.access$800(ActivityThread.java:139)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:136)
          at android.app.ActivityThread.main(ActivityThread.java:5097)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:515)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
          at dalvik.system.NativeStart.main(Native Method)
          Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo

          {who=null, request=18, result=0, data=null}

          to activity

          {com.grassi.manezinhoevoce/com.grassi.manezinhoevoce.MainActivity}

          : java.lang.NullPointerException
          at android.app.ActivityThread.deliverResults(ActivityThread.java:3432)
          at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2788)
          ... 12 more
          Caused by: java.lang.NullPointerException
          at org.apache.cordova.camera.CameraLauncher.failPicture(CameraLauncher.java:1067)
          at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:698)
          at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120)
          at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:321)
          at android.app.Activity.dispatchActivityResult(Activity.java:5446)
          at android.app.ActivityThread.deliverResults(ActivityThread.java:3428)
          ... 13 more

          Show
          joaop.grassi Joao Grassi added a comment - I'm getting it too. Android 4.4 (Moto G (titan_umtsds)) java.lang.RuntimeException: Unable to resume activity {com.grassi.manezinhoevoce/com.grassi.manezinhoevoce.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=0, data=null} to activity {com.grassi.manezinhoevoce/com.grassi.manezinhoevoce.MainActivity} : java.lang.NullPointerException at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2812) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2845) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2262) at android.app.ActivityThread.access$800(ActivityThread.java:139) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5097) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo {who=null, request=18, result=0, data=null} to activity {com.grassi.manezinhoevoce/com.grassi.manezinhoevoce.MainActivity} : java.lang.NullPointerException at android.app.ActivityThread.deliverResults(ActivityThread.java:3432) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2788) ... 12 more Caused by: java.lang.NullPointerException at org.apache.cordova.camera.CameraLauncher.failPicture(CameraLauncher.java:1067) at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:698) at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120) at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:321) at android.app.Activity.dispatchActivityResult(Activity.java:5446) at android.app.ActivityThread.deliverResults(ActivityThread.java:3428) ... 13 more
          Hide
          Hirbod Hirbod added a comment -

          I've the same problem here. Do you use Crosswalk? I'm starting to think that could be related to that..

          java.lang.RuntimeException: Unable to resume activity

          {net.nachbarschaft/net.nachbarschaft.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content://media/external/images/media/3393 flg=0x1 (has extras) }} to activity {net.nachbarschaft/net.nachbarschaft.MainActivity}

          : java.lang.NullPointerException: Attempt to read from field 'org.apache.cordova.PluginManager org.apache.cordova.CordovaWebView.pluginManager' on a null object reference
          at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4002)
          at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4033)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3229)
          at android.app.ActivityThread.access$1000(ActivityThread.java:198)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1676)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:145)
          at android.app.ActivityThread.main(ActivityThread.java:6837)
          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:1404)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
          Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content://media/external/images/media/3393 flg=0x1 (has extras) }} to activity

          {net.nachbarschaft/net.nachbarschaft.MainActivity}

          : java.lang.NullPointerException: Attempt to read from field 'org.apache.cordova.PluginManager org.apache.cordova.CordovaWebView.pluginManager' on a null object reference
          at android.app.ActivityThread.deliverResults(ActivityThread.java:4672)
          at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3988)
          ... 11 more
          Caused by: java.lang.NullPointerException: Attempt to read from field 'org.apache.cordova.PluginManager org.apache.cordova.CordovaWebView.pluginManager' on a null object reference
          at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:837)
          at android.app.Activity.dispatchActivityResult(Activity.java:6758)
          at android.app.ActivityThread.deliverResults(ActivityThread.java:4668)
          ... 12 more

          Show
          Hirbod Hirbod added a comment - I've the same problem here. Do you use Crosswalk? I'm starting to think that could be related to that.. java.lang.RuntimeException: Unable to resume activity {net.nachbarschaft/net.nachbarschaft.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content://media/external/images/media/3393 flg=0x1 (has extras) }} to activity {net.nachbarschaft/net.nachbarschaft.MainActivity} : java.lang.NullPointerException: Attempt to read from field 'org.apache.cordova.PluginManager org.apache.cordova.CordovaWebView.pluginManager' on a null object reference at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4002) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4033) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3229) at android.app.ActivityThread.access$1000(ActivityThread.java:198) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1676) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6837) 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:1404) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=18, result=-1, data=Intent { dat=content://media/external/images/media/3393 flg=0x1 (has extras) }} to activity {net.nachbarschaft/net.nachbarschaft.MainActivity} : java.lang.NullPointerException: Attempt to read from field 'org.apache.cordova.PluginManager org.apache.cordova.CordovaWebView.pluginManager' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:4672) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3988) ... 11 more Caused by: java.lang.NullPointerException: Attempt to read from field 'org.apache.cordova.PluginManager org.apache.cordova.CordovaWebView.pluginManager' on a null object reference at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:837) at android.app.Activity.dispatchActivityResult(Activity.java:6758) at android.app.ActivityThread.deliverResults(ActivityThread.java:4668) ... 12 more
          Hide
          joaop.grassi Joao Grassi added a comment -

          No, I'm not using Crosswalk. I'm also unable to reproduce it, but I'm still getting a few crash reports at Google Play.

          Show
          joaop.grassi Joao Grassi added a comment - No, I'm not using Crosswalk. I'm also unable to reproduce it, but I'm still getting a few crash reports at Google Play.
          Hide
          ecorbel Elodie Corbel added a comment - - edited

          My app is also crashing with same error. I don't use Crosswalk and it crashes on a Sony Xperia SP with Cyanogenmod 10.2 (Android 4.3.1). It doesn't always happen.
          Maybe the problem is Cyanogenmod ?
          Here is the log :

          E/AndroidRuntime(21796): FATAL EXCEPTION: main
          E/AndroidRuntime(21796): java.lang.RuntimeException: Unable to resume activity {com.monappli/com.monappli.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=33, result=-1, data=null
          } to activity {com.monappli/com.monappli.MainActivity}: java.lang.NullPointerException
          E/AndroidRuntime(21796):        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2918)
          E/AndroidRuntime(21796):        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2947)
          E/AndroidRuntime(21796):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2394)
          E/AndroidRuntime(21796):        at android.app.ActivityThread.access$600(ActivityThread.java:153)
          E/AndroidRuntime(21796):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269)
          E/AndroidRuntime(21796):        at android.os.Handler.dispatchMessage(Handler.java:99)
          E/AndroidRuntime(21796):        at android.os.Looper.loop(Looper.java:137)
          E/AndroidRuntime(21796):        at android.app.ActivityThread.main(ActivityThread.java:5289)
          E/AndroidRuntime(21796):        at java.lang.reflect.Method.invokeNative(Native Method)
          E/AndroidRuntime(21796):        at java.lang.reflect.Method.invoke(Method.java:525)
          E/AndroidRuntime(21796):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
          E/AndroidRuntime(21796):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
          E/AndroidRuntime(21796):        at dalvik.system.NativeStart.main(Native Method)
          E/AndroidRuntime(21796): Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=33, re
          sult=-1, data=null} to activity {com.monappli/com.monappli.MainActivity}: java.lang.NullPointerExceptio
          n
          E/AndroidRuntime(21796):        at android.app.ActivityThread.deliverResults(ActivityThread.java:3495)
          E/AndroidRuntime(21796):        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2905)
          E/AndroidRuntime(21796):        ... 12 more
          E/AndroidRuntime(21796): Caused by: java.lang.NullPointerException
          E/AndroidRuntime(21796):        at org.apache.cordova.camera.CameraLauncher.processResultFromCamera(CameraLauncher.java:400)
          E/AndroidRuntime(21796):        at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:674)
          E/AndroidRuntime(21796):        at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120)
          E/AndroidRuntime(21796):        at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:320)
          E/AndroidRuntime(21796):        at android.app.Activity.dispatchActivityResult(Activity.java:5322)
          E/AndroidRuntime(21796):        at android.app.ActivityThread.deliverResults(ActivityThread.java:3491)
          E/AndroidRuntime(21796):        ... 13 more
          
          Show
          ecorbel Elodie Corbel added a comment - - edited My app is also crashing with same error. I don't use Crosswalk and it crashes on a Sony Xperia SP with Cyanogenmod 10.2 (Android 4.3.1). It doesn't always happen. Maybe the problem is Cyanogenmod ? Here is the log : E/AndroidRuntime(21796): FATAL EXCEPTION: main E/AndroidRuntime(21796): java.lang.RuntimeException: Unable to resume activity {com.monappli/com.monappli.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who= null , request=33, result=-1, data= null } to activity {com.monappli/com.monappli.MainActivity}: java.lang.NullPointerException E/AndroidRuntime(21796): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2918) E/AndroidRuntime(21796): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2947) E/AndroidRuntime(21796): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2394) E/AndroidRuntime(21796): at android.app.ActivityThread.access$600(ActivityThread.java:153) E/AndroidRuntime(21796): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269) E/AndroidRuntime(21796): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(21796): at android.os.Looper.loop(Looper.java:137) E/AndroidRuntime(21796): at android.app.ActivityThread.main(ActivityThread.java:5289) E/AndroidRuntime(21796): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(21796): at java.lang.reflect.Method.invoke(Method.java:525) E/AndroidRuntime(21796): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) E/AndroidRuntime(21796): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555) E/AndroidRuntime(21796): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime(21796): Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who= null , request=33, re sult=-1, data= null } to activity {com.monappli/com.monappli.MainActivity}: java.lang.NullPointerExceptio n E/AndroidRuntime(21796): at android.app.ActivityThread.deliverResults(ActivityThread.java:3495) E/AndroidRuntime(21796): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2905) E/AndroidRuntime(21796): ... 12 more E/AndroidRuntime(21796): Caused by: java.lang.NullPointerException E/AndroidRuntime(21796): at org.apache.cordova.camera.CameraLauncher.processResultFromCamera(CameraLauncher.java:400) E/AndroidRuntime(21796): at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:674) E/AndroidRuntime(21796): at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120) E/AndroidRuntime(21796): at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:320) E/AndroidRuntime(21796): at android.app.Activity.dispatchActivityResult(Activity.java:5322) E/AndroidRuntime(21796): at android.app.ActivityThread.deliverResults(ActivityThread.java:3491) E/AndroidRuntime(21796): ... 13 more
          Hide
          markharding Mark Harding added a comment -

          The issue seems to be related to the main activated being destroyed,
          from what I can see.

          Show
          markharding Mark Harding added a comment - The issue seems to be related to the main activated being destroyed, from what I can see.
          Hide
          cmellinas MELLINAS added a comment -

          Exactly the same issue here in Google Play CRASHES & ANRS (1 crash) :

          Android version : Android 5.0
          Device : Xperia Z (C6603)

          I use crosswalk(last version)

          Show
          cmellinas MELLINAS added a comment - Exactly the same issue here in Google Play CRASHES & ANRS (1 crash) : Android version : Android 5.0 Device : Xperia Z (C6603) I use crosswalk(last version)
          Hide
          mickaelmagniez Mickael Magniez added a comment -

          HI,

          It seems to happen when GC kill cordova Main Activity (for example when camera activity is started, cordova main activity is stopped, and if phone has low memory, android can choose to kill cordova main activity).

          To reproduce : check "Don't keep activities" options in developer option menu of your phone, and call camera.getPicture(), application crash when going back from camea to Main Activity

          Show
          mickaelmagniez Mickael Magniez added a comment - HI, It seems to happen when GC kill cordova Main Activity (for example when camera activity is started, cordova main activity is stopped, and if phone has low memory, android can choose to kill cordova main activity). To reproduce : check "Don't keep activities" options in developer option menu of your phone, and call camera.getPicture(), application crash when going back from camea to Main Activity
          Hide
          riknoll Richard B Knoll added a comment - - edited

          Yes, I can confirm this is present in the camera plugin v1.2.0 on Android 5.1.1 (not Cyanogenmod). It definitely seems to be related to Activities getting killed in the background. There is nothing we can do about the Activity dying, but crashing definitely seems like the incorrect response. I've updated the priority to critical because of the amount of activity on this thread.

          Show
          riknoll Richard B Knoll added a comment - - edited Yes, I can confirm this is present in the camera plugin v1.2.0 on Android 5.1.1 (not Cyanogenmod). It definitely seems to be related to Activities getting killed in the background. There is nothing we can do about the Activity dying, but crashing definitely seems like the incorrect response. I've updated the priority to critical because of the amount of activity on this thread.
          Hide
          riknoll Richard B Knoll added a comment -

          CB-9649 has a good description of the issue.

          Show
          riknoll Richard B Knoll added a comment - CB-9649 has a good description of the issue.
          Hide
          riknoll Richard B Knoll added a comment -

          So after thinking about this some more, I think that failing might be the correct behavior for now. The fact is that we do not handle the Activity getting killed in the background and we shouldn't pretend that we do by removing the exception. The core issue of this problem is the much more general headache of not handling the lifecycle properly which is a very hard thing to do within the constraints of Cordova Android. For those interested, there is some discussion about one solution to this lifecycle problem happening in the pull request associated with CB-8804. I think we should leave this issue open until a larger decision is made.

          Show
          riknoll Richard B Knoll added a comment - So after thinking about this some more, I think that failing might be the correct behavior for now. The fact is that we do not handle the Activity getting killed in the background and we shouldn't pretend that we do by removing the exception. The core issue of this problem is the much more general headache of not handling the lifecycle properly which is a very hard thing to do within the constraints of Cordova Android. For those interested, there is some discussion about one solution to this lifecycle problem happening in the pull request associated with CB-8804 . I think we should leave this issue open until a larger decision is made.
          Hide
          riknoll Richard B Knoll added a comment -

          I proposed a generic solution to this problem in https://github.com/apache/cordova-android/pull/236

          Show
          riknoll Richard B Knoll added a comment - I proposed a generic solution to this problem in https://github.com/apache/cordova-android/pull/236
          Hide
          riknoll Richard B Knoll added a comment -

          I merged in my CB-8917 fix, so a PR that properly solves this issue is incoming!

          Show
          riknoll Richard B Knoll added a comment - I merged in my CB-8917 fix, so a PR that properly solves this issue is incoming!
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user riknoll opened a pull request:

          https://github.com/apache/cordova-plugin-camera/pull/145

          CB-9189 android: Implementing save/restore API to handle Activity destruction

          This fixes the long standing issue of the camera plugin crashing after receiving an Activity result when the Cordova Activity is killed in the background (CB-9189). Uses the new API for plugin save/restore that was merged into cordova-android recently.

          NOTE: The link I put in the README is for Android docs that have been merged in to dev, but not published yet. It'll work once we do a docs release. Right now it's broken.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/MSOpenTech/cordova-plugin-camera CB-9189

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/cordova-plugin-camera/pull/145.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #145


          commit e3029157bdcfd8d19e25a2f3be1c81bd7a8f8589
          Author: riknoll <richard.b.knoll@gmail.com>
          Date: 2015-12-04T19:34:28Z

          CB-9189 android: Implementing save/restore API to handle Activity destruction


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user riknoll opened a pull request: https://github.com/apache/cordova-plugin-camera/pull/145 CB-9189 android: Implementing save/restore API to handle Activity destruction This fixes the long standing issue of the camera plugin crashing after receiving an Activity result when the Cordova Activity is killed in the background ( CB-9189 ). Uses the new API for plugin save/restore that was merged into cordova-android recently. NOTE : The link I put in the README is for Android docs that have been merged in to dev, but not published yet. It'll work once we do a docs release. Right now it's broken. You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-plugin-camera CB-9189 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-camera/pull/145.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #145 commit e3029157bdcfd8d19e25a2f3be1c81bd7a8f8589 Author: riknoll <richard.b.knoll@gmail.com> Date: 2015-12-04T19:34:28Z CB-9189 android: Implementing save/restore API to handle Activity destruction
          Hide
          s.gomez sandrine gomez added a comment - - edited

          I also have encountered a java.lang.NullPointerException with Camera plugin.

          Do you think this is the same problem ?

          On Android 4.2 (Samsung Galaxy Trend Plus) :

          java.lang.RuntimeException: Unable to resume activity

          {com.neopostshipping.pod4carriers/com.neopostshipping.pod4carriers.POD4Carriers}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=34, result=-1, data=null} to activity {com.neopostshipping.pod4carriers/com.neopostshipping.pod4carriers.POD4Carriers}

          : java.lang.NullPointerException
          at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2853)
          at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2882)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2314)
          at android.app.ActivityThread.access$700(ActivityThread.java:157)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:176)
          at android.app.ActivityThread.main(ActivityThread.java:5317)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:511)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
          at dalvik.system.NativeStart.main(Native Method)
          Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo

          {who=null, request=34, result=-1, data=null}

          to activity

          {com.neopostshipping.pod4carriers/com.neopostshipping.pod4carriers.POD4Carriers}

          : java.lang.NullPointerException
          at android.app.ActivityThread.deliverResults(ActivityThread.java:3433)
          at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2827)
          ... 12 more
          Caused by: java.lang.NullPointerException
          at org.apache.cordova.camera.CameraLauncher.processResultFromCamera(CameraLauncher.java:445)
          at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:674)
          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:5515)
          at android.app.ActivityThread.deliverResults(ActivityThread.java:3429)
          ... 13 more

          Show
          s.gomez sandrine gomez added a comment - - edited I also have encountered a java.lang.NullPointerException with Camera plugin. Do you think this is the same problem ? On Android 4.2 (Samsung Galaxy Trend Plus) : java.lang.RuntimeException: Unable to resume activity {com.neopostshipping.pod4carriers/com.neopostshipping.pod4carriers.POD4Carriers}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=34, result=-1, data=null} to activity {com.neopostshipping.pod4carriers/com.neopostshipping.pod4carriers.POD4Carriers} : java.lang.NullPointerException at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2853) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2882) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2314) at android.app.ActivityThread.access$700(ActivityThread.java:157) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:176) at android.app.ActivityThread.main(ActivityThread.java:5317) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo {who=null, request=34, result=-1, data=null} to activity {com.neopostshipping.pod4carriers/com.neopostshipping.pod4carriers.POD4Carriers} : java.lang.NullPointerException at android.app.ActivityThread.deliverResults(ActivityThread.java:3433) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2827) ... 12 more Caused by: java.lang.NullPointerException at org.apache.cordova.camera.CameraLauncher.processResultFromCamera(CameraLauncher.java:445) at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:674) 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:5515) at android.app.ActivityThread.deliverResults(ActivityThread.java:3429) ... 13 more
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user riknoll commented on the pull request:

          https://github.com/apache/cordova-plugin-camera/pull/145#issuecomment-169152599

          Rebased to master and update the README link. Sorry, I lost track of this over the holidays. I plan to merge this in at end of day. @jasongin can you give this a quick look?

          Show
          githubbot ASF GitHub Bot added a comment - Github user riknoll commented on the pull request: https://github.com/apache/cordova-plugin-camera/pull/145#issuecomment-169152599 Rebased to master and update the README link. Sorry, I lost track of this over the holidays. I plan to merge this in at end of day. @jasongin can you give this a quick look?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user jasongin commented on the pull request:

          https://github.com/apache/cordova-plugin-camera/pull/145#issuecomment-169153798

          LGTM

          Show
          githubbot ASF GitHub Bot added a comment - Github user jasongin commented on the pull request: https://github.com/apache/cordova-plugin-camera/pull/145#issuecomment-169153798 LGTM
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit e2193631d552bc8ad97cb0ce69413bc85dc6c821 in cordova-plugin-camera's branch refs/heads/master from riknoll
          [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-camera.git;h=e219363 ]

          CB-9189 android: Implementing save/restore API to handle Activity destruction

          Show
          jira-bot ASF subversion and git services added a comment - Commit e2193631d552bc8ad97cb0ce69413bc85dc6c821 in cordova-plugin-camera's branch refs/heads/master from riknoll [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-camera.git;h=e219363 ] CB-9189 android: Implementing save/restore API to handle Activity destruction
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/cordova-plugin-camera/pull/145

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/cordova-plugin-camera/pull/145
          Hide
          riknoll Richard B Knoll added a comment -

          Finally merged! Check out the Android Lifecycle Guide for usage: http://cordova.apache.org/docs/en/dev/guide/platforms/android/lifecycle.html

          Show
          riknoll Richard B Knoll added a comment - Finally merged! Check out the Android Lifecycle Guide for usage: http://cordova.apache.org/docs/en/dev/guide/platforms/android/lifecycle.html
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user riknoll commented on the pull request:

          https://github.com/apache/cordova-plugin-camera/pull/147#issuecomment-171800191

          @nikhilkh is right; the issue you are referencing is CB-9189(https://issues.apache.org/jira/browse/CB-9189). There was a fix for that merged recently and I wrote about how to use it in the comments [here](https://issues.apache.org/jira/browse/CB-10309). Hope that helps!

          Show
          githubbot ASF GitHub Bot added a comment - Github user riknoll commented on the pull request: https://github.com/apache/cordova-plugin-camera/pull/147#issuecomment-171800191 @nikhilkh is right; the issue you are referencing is CB-9189 ( https://issues.apache.org/jira/browse/CB-9189 ). There was a fix for that merged recently and I wrote about how to use it in the comments [here] ( https://issues.apache.org/jira/browse/CB-10309 ). Hope that helps!
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user riknoll commented on the pull request:

          https://github.com/apache/cordova-docs/pull/462#issuecomment-173770573

          Here's my blurb:

          This update introduces a new API for Android plugin authors. Plugins that launch external activities can now better handle method calls on devices that are low on memory. In that scenario, the Android OS will sometimes kill the Cordova Activity when it is pushed into the background by the external Activity. This causes the plugin to lose any callbacks they have pending in the javascript. The new API allows the results of external Activity calls to be delivered via the `resume` event that is fired in the javascript after the Cordova Activity is destroyed and recreated. Plugin authors wishing to implement the new API should read the updated plugin guide [here](http://cordova.apache.org/docs/en/dev/guide/platforms/android/plugin.html).

          Two core plugins support this new API and have been updated to fix longstanding bugs:

          Application authors are encouraged to update both their plugin and cordova-android versions to take advantage of these bug fixes. Please note that the aforementioned fixes require changes to your application as well. More information can be found in the READMEs of each of those plugins and in the new [Android lifecycle guide](http://cordova.apache.org/docs/en/dev/guide/platforms/android/lifecycle.html) that has been published to the Cordova documentation. This guide provides explanations and guidance on how to handle low memory scenarios on the Android platform as well as integrate the new resume APIs into your application.

          Show
          githubbot ASF GitHub Bot added a comment - Github user riknoll commented on the pull request: https://github.com/apache/cordova-docs/pull/462#issuecomment-173770573 Here's my blurb: This update introduces a new API for Android plugin authors. Plugins that launch external activities can now better handle method calls on devices that are low on memory. In that scenario, the Android OS will sometimes kill the Cordova Activity when it is pushed into the background by the external Activity. This causes the plugin to lose any callbacks they have pending in the javascript. The new API allows the results of external Activity calls to be delivered via the `resume` event that is fired in the javascript after the Cordova Activity is destroyed and recreated. Plugin authors wishing to implement the new API should read the updated plugin guide [here] ( http://cordova.apache.org/docs/en/dev/guide/platforms/android/plugin.html ). Two core plugins support this new API and have been updated to fix longstanding bugs: cordova-plugin-camera@2.1.0 (fixes CB-9189 ( https://issues.apache.org/jira/browse/CB-9189 )) cordova-plugin-contacts@2.0.1 (fixes CB-10159 ( https://issues.apache.org/jira/browse/CB-10159 )) Application authors are encouraged to update both their plugin and cordova-android versions to take advantage of these bug fixes. Please note that the aforementioned fixes require changes to your application as well. More information can be found in the READMEs of each of those plugins and in the new [Android lifecycle guide] ( http://cordova.apache.org/docs/en/dev/guide/platforms/android/lifecycle.html ) that has been published to the Cordova documentation. This guide provides explanations and guidance on how to handle low memory scenarios on the Android platform as well as integrate the new resume APIs into your application.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user dhams commented on the pull request:

          https://github.com/apache/cordova-docs/pull/462#issuecomment-175609597

          Sorry guys but that not comes with the fixes ... Same #/CB-9189 is still there even after update 5.4.1

          Show
          githubbot ASF GitHub Bot added a comment - Github user dhams commented on the pull request: https://github.com/apache/cordova-docs/pull/462#issuecomment-175609597 Sorry guys but that not comes with the fixes ... Same #/ CB-9189 is still there even after update 5.4.1

            People

            • Assignee:
              riknoll Richard B Knoll
              Reporter:
              markharding Mark Harding
            • Votes:
              2 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development