[TIMOB-25056] On Android 7.0 Ti.Media.showCamera crashes after taking photo and tapping Retry or pressing back button
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | Release 7.0.0 |
Components | Android |
Labels | n/a |
Reporter | Brian Knorr |
Assignee | Lokesh Choudhary |
Created | 2017-06-20T16:36:03.000+0000 |
Updated | 2018-02-12T11:28:48.000+0000 |
Description
When using Ti.Media.showCamera on Android 7.0 with Ti SDK 6.1.0 the camera app will crash after the user takes a photo and either taps Retry or presses the back button. It's very easy to reproduce by running the method Ti.Media.showCamera(options).
Below is the exception and seems to be caused by the new TiFileProvider
[ERROR] DatabaseUtils: Writing exception to parcel
[ERROR] DatabaseUtils: java.lang.UnsupportedOperationException: No external deletions
[ERROR] DatabaseUtils: at org.appcelerator.titanium.io.TiFileProvider.delete(TiFileProvider.java:45)
[ERROR] DatabaseUtils: at android.content.ContentProvider$Transport.delete(ContentProvider.java:344)
[ERROR] DatabaseUtils: at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:206)
[ERROR] DatabaseUtils: at android.os.Binder.execTransact(Binder.java:573)
The specific device we are seeing this issue on is Samsung S7 running Android 7.0.
Here is a better stack trace: 06-20 18:03:38.643 17691 17703 E DatabaseUtils: Writing exception to parcel 06-20 18:03:38.643 17691 17703 E DatabaseUtils: java.lang.UnsupportedOperationException: No external deletions 06-20 18:03:38.643 17691 17703 E DatabaseUtils: at org.appcelerator.titanium.io.TiFileProvider.delete(TiFileProvider.java:45) 06-20 18:03:38.643 17691 17703 E DatabaseUtils: at android.content.ContentProvider$Transport.delete(ContentProvider.java:344) 06-20 18:03:38.643 17691 17703 E DatabaseUtils: at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:206) 06-20 18:03:38.643 17691 17703 E DatabaseUtils: at android.os.Binder.execTransact(Binder.java:573) 06-20 18:03:38.644 18280 22759 I SA : [OCP] Cursor is not null 06-20 18:03:38.644 25323 25323 D AndroidRuntime: Shutting down VM 06-20 18:03:38.645 25323 25323 E AndroidRuntime: FATAL EXCEPTION: main 06-20 18:03:38.645 25323 25323 E AndroidRuntime: Process: com.sec.android.app.camera, PID: 25323 06-20 18:03:38.645 25323 25323 E AndroidRuntime: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2001, result=0, data=Intent { launchParam=MultiScreenLaunchParams { mDisplayId=0 mFlags=0 }(has extras) }} to activity {com.sec.android.app.camera/com.sec.android.app.camera.Camera}: java.lang.UnsupportedOperationException: No external deletions 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at android.app.ActivityThread.deliverResults(ActivityThread.java:4525) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at android.app.ActivityThread.handleSendResult(ActivityThread.java:4568) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at android.app.ActivityThread.-wrap22(ActivityThread.java) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1706) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6688) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: Caused by: java.lang.UnsupportedOperationException: No external deletions 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:167) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at android.content.ContentProviderProxy.delete(ContentProviderNative.java:544) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at android.content.ContentResolver.delete(ContentResolver.java:1377) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at com.sec.android.app.camera.Camera.onActivityResult(Camera.java:5153) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at android.app.Activity.dispatchActivityResult(Activity.java:7226) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: at android.app.ActivityThread.deliverResults(ActivityThread.java:4521) 06-20 18:03:38.645 25323 25323 E AndroidRuntime: ... 9 more
I'm unable to reproduce using this test case:
Could you provide a test case that reproduces this issue?
hey [~gmathews] per customer: just generate a new Alloy project and add these lines of code in the app/controllers/index.js file:
[~vvazquezmontero] Tested the case above, I cannot reproduce the issue. Pressing
Retry
or navigating back works as expected.[~lchoudhary] Please try this one and see if you can reproduce.
[~lchoudhary] Do we have any update on this ticket?
@Lokesh Choudhary, I have also faced this error on Nokia 5 - Android OS 7.1.2 today morning. I ran many many tests but could not find anything on console. When app crashes, it doesn't even prints on console, not even in Trace Console mode. There's just nothing printed on console. As per tests I ran, I can surely say 1 thing that since I was not able to see any log on console, it's pretty much sure that no callback is called at all. neither success, nor cancel, nor error callback. I had two camera apps installed, one is device's inbuilt camera & other a 3rd party app. I noticed something very weird that after clearing the Default Camera app, showCamera() method shows a list to chose camera & if I chose camera A for very first time, app crashes even after pressing back button without capturing photo. Next time I choose Camera A again, & it doesn't crash. But if I chose Camera B after Camera A, it crashes without any callback called. So, it's sure that switching between camera apps crashes the app, be it inbuilt camera app or any other 3rd party app. You guys really need to figure this out since the camera feature is not working at all in Android 7 or +
[~lchoudhary] this ticket can be closed
[~lchoudhary] we are good to close original servicenow ticket is closed