Titanium JIRA Archive
Appcelerator Community (AC)

[AC-761] Google Play Crash Report: RuntimeException - TiCameraActivity startPreview failed

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2014-07-09T22:21:19.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, android-4.0, android-4.3, android-4.4, camera, crash
ReporterAlex Bernier
AssigneeMauro Parra-Miranda
Created2014-06-09T15:11:26.000+0000
Updated2016-03-08T07:37:01.000+0000

Description

Stack trace

java.lang.RuntimeException: startPreview failed
at android.hardware.Camera.startPreview(Native Method)
at ti.modules.titanium.media.TiCameraActivity$3.onPictureTaken(TiCameraActivity.java:502)
at android.hardware.Camera$EventHandler.handleMessage(Camera.java:692)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)

Attachments

FileDateSize
Screen Shot 2014-06-09 at 8.10.43 AM.png2014-06-09T15:11:26.000+000091794

Comments

  1. Ritu Agrawal 2014-06-09

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

    Hi Ritu, Here is the camera code we roughly use. Very straightforward:
       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(); 
       
    The showApprovalPage function opens a window with an imageView in it and a button for the user to approve the image.
  3. Mauro Parra-Miranda 2014-06-30

    Hello [~athorne]! Do you mind to test your testcase with 3.3.0? Looks like it's fixed now. I tested your testcase with Moto X, Android 4.4.2, Mobile SDK 3.3.0 Best Regards,
  4. Mauro Parra-Miranda 2014-07-09

    This is fixed in 3.3.0.RC.
  5. Alex Bernier 2014-10-08

    Hi Mauro Parra-Miranda, I'll try it out. I'm upgrading to 3.4 as we speak. I couldn't reproduce it, only got reports of it from the Play Store, but I'll reply back if I release and get more reports of it. Thank you for closing the loop with me!

JSON Source