在“科尔多瓦”中成功回​​调相机的“致命异常:主要”

时间:2015-02-03 12:28:28

标签: android cordova

我正在使用cordova 3.6和android 4.4,我使用了一个简单的例子来打开相机或从图库中选择图片但是每次成功回调相机都会出现以下错误

02-03 16:39:04.279: E/AndroidRuntime(3403): FATAL EXCEPTION: main
02-03 16:39:04.279: E/AndroidRuntime(3403): 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
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2732)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2760)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2216)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at android.app.ActivityThread.access$600(ActivityThread.java:149)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1300)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at android.os.Handler.dispatchMessage(Handler.java:99)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at android.os.Looper.loop(Looper.java:153)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at android.app.ActivityThread.main(ActivityThread.java:5086)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at java.lang.reflect.Method.invokeNative(Native Method)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at java.lang.reflect.Method.invoke(Method.java:511)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at dalvik.system.NativeStart.main(Native Method)
    02-03 16:39:04.279: E/AndroidRuntime(3403): Caused by: 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
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at android.app.ActivityThread.deliverResults(ActivityThread.java:3302)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2715)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  ... 12 more
    02-03 16:39:04.279: E/AndroidRuntime(3403): Caused by: java.lang.NullPointerException
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:779)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at android.app.Activity.dispatchActivityResult(Activity.java:5204)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  at android.app.ActivityThread.deliverResults(ActivityThread.java:3298)
    02-03 16:39:04.279: E/AndroidRuntime(3403):  ... 13 more
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403): Logger$UncaughtExceptionHandler.uncaughtException in Logger.java:438 :: Uncaught Exception
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403): 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
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2732)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2760)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2216)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at android.app.ActivityThread.access$600(ActivityThread.java:149)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1300)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at android.os.Handler.dispatchMessage(Handler.java:99)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at android.os.Looper.loop(Looper.java:153)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at android.app.ActivityThread.main(ActivityThread.java:5086)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at java.lang.reflect.Method.invokeNative(Native Method)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at java.lang.reflect.Method.invoke(Method.java:511)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at dalvik.system.NativeStart.main(Native Method)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403): Caused by: 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
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at android.app.ActivityThread.deliverResults(ActivityThread.java:3302)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2715)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  ... 12 more
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403): Caused by: java.lang.NullPointerException
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:779)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at android.app.Activity.dispatchActivityResult(Activity.java:5204)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  at android.app.ActivityThread.deliverResults(ActivityThread.java:3298)
    02-03 16:39:04.287: E/com.worklight.common.Logger$UncaughtExceptionHandler(3403):  ... 13 more
    02-03 16:39:04.291: D/wl(3403): WL.doPrepareAssetsWork in WL.java:287 :: no need to check web resource integrity

我也尝试过不同的机器,但遇到同样的问题。

0 个答案:

没有答案