Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1464] Google Play Crash Report: RuntimeException - Unable to resume activity TiCameraActivity

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2014-06-30T07:19:46.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, android-4.4, camera, crash
ReporterAlex Bernier
AssigneeMauro Parra-Miranda
Created2014-06-09T14:37:47.000+0000
Updated2016-03-08T07:37:54.000+0000

Description

Details

* I'm using an overlay with the camera

Stack trace

java.lang.RuntimeException: Unable to resume activity {com.twogrand.twogrand/ti.modules.titanium.media.TiCameraActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2788)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2817)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
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:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at ti.modules.titanium.media.TiCameraActivity.onResume(TiCameraActivity.java:207)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
at android.app.Activity.performResume(Activity.java:5310)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2778)
... 12 more

Attachments

FileDateSize
Screen Shot 2014-06-09 at 7.30.29 AM.png2014-06-09T14:37:47.000+0000146876

Comments

  1. Ritu Agrawal 2014-06-09

    Please provide a simple runnable test case to reproduce this issue.
  2. Alex Bernier 2014-06-16

    Hi Ritu, I understand a test case would help but I can't reproduce this issue and was hoping the stack trace would provide some information to help Appcelerator guide me in the right direction debugging this. This is the basic camera code, using an overlay:
       var win = Ti.UI.createWindow({
       	backgroundColor : "#FFF"
       });
       
       var overlay = Ti.UI.createView({
       	backgroundColor : "transparent",
       	height : Ti.UI.FILL,
       	width : Ti.UI.FILL
       });
       
       overlay.add(Ti.UI.createView({
       	backgroundColor : "red",
       	height : 20,
       	width : Ti.UI.FILL
       }));
       
       win.addEventListener('click', function() {
       	Ti.Media.showCamera({
       		overlay : overlay,
       		success : function(event) {
       			Ti.Media.hideCamera();
       
       			//showApprovalPage(event.media);
       		},
       		cancel : function(e) {
       		},
       		error : function(e) {
       		},
       		saveToPhotoGallery : false,
       		allowEditing : false,
       		transform : null,
       		mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],
       		showControls : false,
       		autohide : false,
       		animated : false
       	});
       });
       
       win.open(); 
       
    Maybe the resume issue is somehow caused by the camera having an overlay? Maybe I should close the camera when the app is paused to avoid this?
  3. Mauro Parra-Miranda 2014-06-30

    DUP of TC-4234

JSON Source