[AC-761] Google Play Crash Report: RuntimeException - TiCameraActivity startPreview failed
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2014-07-09T22:21:19.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Titanium SDK & CLI |
| Labels | android, android-4.0, android-4.3, android-4.4, camera, crash |
| Reporter | Alex Bernier |
| Assignee | Mauro Parra-Miranda |
| Created | 2014-06-09T15:11:26.000+0000 |
| Updated | 2016-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
| File | Date | Size |
|---|---|---|
| Screen Shot 2014-06-09 at 8.10.43 AM.png | 2014-06-09T15:11:26.000+0000 | 91794 |
Please provide a simple runnable test case to reproduce the issue.
Hi Ritu, Here is the camera code we roughly use. Very straightforward:
The showApprovalPage function opens a window with an imageView in it and a button for the user to approve the image.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();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,
This is fixed in 3.3.0.RC.
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!