[TIMOB-20260] Android 6: CameraView with overlay crash with message "AppName is not responding"
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-02-04T22:03:18.000+0000 |
Affected Version/s | Release 5.1.2, Release 5.1.1 |
Fix Version/s | Release 5.2.0 |
Components | Android |
Labels | Android6.0, camera, module_media, qe-testadded |
Reporter | Ricardo Ramirez |
Assignee | Ashraf Abu |
Created | 2016-01-20T23:56:19.000+0000 |
Updated | 2017-07-10T11:04:25.000+0000 |
Description
Issue Description
Android 6.0 camera view with overlay sometimes hangs after taking a picture. The hang resumes for about 45 seconds to a minute after which the app crashes with message "AppName is not responding". After closing the app camera issue persist. Even native camera app is not working as the result of this crash. The only way to restore both apps to working state is to restart users device. This was tested on on Nexus 9 tablet and Nexus 5X devices running Marshmallow 6.0.1Steps to replicate:
Create a new Alloy Default Project
Open the app folder and replace the existing folders with the attached files
Run
Press "Open Camera" button; you should be presented with camera screen with an
overlay.Press "Take" button
If the app does not crash a preview screen will appear with captured picture. If that
happens either press "Keep" button to return to main page or press "Retake" button to come back to camera screen.Keep taking pictured until crash is reproduced (it sometimes takes a few tries to
reproduce).Attachments
File | Date | Size |
---|---|---|
cameraTest.zip | 2016-01-20T23:55:48.000+0000 | 7213 |
I'm sorry ! please download the full test-case here: https://drive.google.com/file/d/0BwTWo-c2a0b9OFhTZzVtR0IzMDQ/view?usp=sharing
5_2_X PR: https://github.com/appcelerator/titanium_mobile/pull/7679 Master PR: https://github.com/appcelerator/titanium_mobile/pull/7680
Verified the fix. There is no ANR & issue if camera not being released due to it. Closing. Environment: Appc Studio : 4.5.0.201601262138 Ti SDK : 5.2.0.v20160204140025 Ti CLI : 5.0.6 Alloy : 1.7.33 MAC Yosemite : 10.10.5 Appc NPM : 4.2.3-2 Appc CLI : 5.2.0-242 Node: 4.2.2 Nexus 6P - Android 6.0
[~mfogg] So you are getting multiple success? Which is caused by https://github.com/appcelerator/titanium_mobile/pull/7679/files? Could you provide the a sample app if you can and the log.
For anyone who's running into this issue (and feels like hacking in a solution like we did), the solution we came up with was to only allow the "onAutoFocus" callback to be fired once. We modified that function to include:
And then replace the takePicture() function with:
This has "solved" the problem for us in the short term. Definitely not a long term solution.
I'm also caught this error in 6.1.1.GA, but I don' t understand is it fixed or I should do something?