[AC-5890] Android: Camera activity crashes app on some devices
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2018-11-28T22:33:16.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android, camera |
Reporter | Michael Gangolf |
Assignee | Shak Hossain |
Created | 2018-09-16T11:21:17.000+0000 |
Updated | 2018-11-28T22:33:16.000+0000 |
Description
Attachments
File | Date | Size |
---|---|---|
test_camera.zip | 2018-09-20T05:35:07.000+0000 | 710410 |
ti_camera_issue.mp4 | 2018-09-18T16:22:01.000+0000 | 2775275 |
ti_camera_issue2.mp4 | 2018-09-20T15:24:44.000+0000 | 6341178 |
Hello, I have tried to reproduce the issue in Nokia 6 Android 8.1.0. I wasn't able to reproduce the crash. The camera overlay opens fine. Is this only happening for your HTC A9? any other device this is reproducible? Thanks.
I've updated the example with a simple button to re-open the camera and added a video of my device (sorry for the rotation, it's a recording from the device with scrcpy and it rotates the screen). I've tested it on a Samsung A5 (2017) and a Moto G2 without a problem. But as you can see in the 100 comments in the old thread its happening on other devices (e.g. a Nexus 5x, Moto E, Moto G3), too. I'll try to get some other devices to record a log.
Oh and I don't even need to take a picture! I can just go back (back arrow in the Android menu) after the camera is opened and it will restart the app. So as soon as the camera is opened my app is closed. So if I add a log to the MediaModule.java the last thing I see is:
activity.runOnUiThread(resultHandler);
inlaunchNativeCamera
theonResult
in theCameraResultHandler
is never reached. A normal camera route looks like this in the logHello, Attach a full sample project that can be imported and run on the studio. Thanks.
Project add. Keep in mind: the log above was done in a custom SDK where I added a log in every function that is called when opening the Camera. So it won't be visibile in the test app!
[~michael], We are unable to reproduce the issue using your sample test project. Can you please check the sample code from [here](https://gist.github.com/rakhimonimitro/20ee61c0571608a7ffee887bd2517349) and let us know how it goes?
Hi [~rmitro], same with this example: compiled, installed: working fine for 4 images (image is shown in the background) then I've closed the app and reopened it took 2 more images and then it restarts and just shows the red background without the image (like a normal app start) {noformat} [WARN] IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection [ERROR] TiMedia: (main) [39493,39493] Camera preview is not open, unable to hide [INFO] Adreno: QUALCOMM build : 6933d31, I73c5708217 [INFO] Adreno: Build Date : 12/28/16 [INFO] Adreno: OpenGL ES Shader Compiler Version: XE031.09.00.04 [INFO] Adreno: Local Branch : [INFO] Adreno: Remote Branch : quic/LA.BR.1.3.6_rb1.11 [INFO] Adreno: Remote Branch : NONE [INFO] Adreno: Reconstruct Branch : NOTHING [INFO] Choreographer: Skipped 36 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 37 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 34 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 34 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 36 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 72 frames! The application may be doing too much work on its main thread. [WARN] InputMethodManager: com.miga.testcamera spent 1594ms to start processing msg:100 [WARN] IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection [INFO] Choreographer: Skipped 53 frames! The application may be doing too much work on its main thread. [ERROR] TiMedia: (main) [11484,50977] Camera preview is not open, unable to hide [INFO] Adreno: QUALCOMM build : 6933d31, I73c5708217 [INFO] Adreno: Build Date : 12/28/16 [INFO] Adreno: OpenGL ES Shader Compiler Version: XE031.09.00.04 [INFO] Adreno: Local Branch : [INFO] Adreno: Remote Branch : quic/LA.BR.1.3.6_rb1.11 [INFO] Adreno: Remote Branch : NONE [INFO] Adreno: Reconstruct Branch : NOTHING [WARN] art: Suspending all threads took: 6.290ms [INFO] art: Background partial concurrent mark sweep GC freed 266(8KB) AllocSpace objects, 1(38MB) LOS objects, 23% free, 52MB/68MB, paused 7.126ms total 54.943ms [INFO] Choreographer: Skipped 38 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 41 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 31 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 72 frames! The application may be doing too much work on its main thread. [WARN] InputMethodManager: com.miga.testcamera spent 1408ms to start processing msg:100 [WARN] IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection [INFO] Choreographer: Skipped 39 frames! The application may be doing too much work on its main thread. [ERROR] TiMedia: (main) [17680,68657] Camera preview is not open, unable to hide [INFO] Adreno: QUALCOMM build : 6933d31, I73c5708217 [INFO] Adreno: Build Date : 12/28/16 [INFO] Adreno: OpenGL ES Shader Compiler Version: XE031.09.00.04 [INFO] Adreno: Local Branch : [INFO] Adreno: Remote Branch : quic/LA.BR.1.3.6_rb1.11 [INFO] Adreno: Remote Branch : NONE [INFO] Adreno: Reconstruct Branch : NOTHING [WARN] art: Suspending all threads took: 5.511ms [INFO] art: Background sticky concurrent mark sweep GC freed 409(53KB) AllocSpace objects, 4(80KB) LOS objects, 0% free, 90MB/90MB, paused 7.380ms total 30.791ms [INFO] Choreographer: Skipped 39 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 41 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 31 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 34 frames! The application may be doing too much work on its main thread. [WARN] InputMethodManager: com.miga.testcamera spent 806ms to start processing msg:100 [WARN] IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection [INFO] Choreographer: Skipped 41 frames! The application may be doing too much work on its main thread. [ERROR] TiMedia: (main) [9678,78335] Camera preview is not open, unable to hide [INFO] Adreno: QUALCOMM build : 6933d31, I73c5708217 [INFO] Adreno: Build Date : 12/28/16 [INFO] Adreno: OpenGL ES Shader Compiler Version: XE031.09.00.04 [INFO] Adreno: Local Branch : [INFO] Adreno: Remote Branch : quic/LA.BR.1.3.6_rb1.11 [INFO] Adreno: Remote Branch : NONE [INFO] Adreno: Reconstruct Branch : NOTHING [INFO] art: Do partial code cache collection, code=21KB, data=30KB [INFO] art: After code cache collection, code=21KB, data=30KB [INFO] art: Increasing code cache capacity to 128KB [INFO] Choreographer: Skipped 41 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 35 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 69 frames! The application may be doing too much work on its main thread. [WARN] InputMethodManager: com.miga.testcamera spent 1300ms to start processing msg:100 [WARN] IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection [INFO] Choreographer: Skipped 31 frames! The application may be doing too much work on its main thread. [ERROR] TiMedia: (main) [8108,86443] Camera preview is not open, unable to hide [INFO] Adreno: QUALCOMM build : 6933d31, I73c5708217 [INFO] Adreno: Build Date : 12/28/16 [INFO] Adreno: OpenGL ES Shader Compiler Version: XE031.09.00.04 [INFO] Adreno: Local Branch : [INFO] Adreno: Remote Branch : quic/LA.BR.1.3.6_rb1.11 [INFO] Adreno: Remote Branch : NONE [INFO] Adreno: Reconstruct Branch : NOTHING [DEBUG] TiBaseActivity: (main) [2066,88509] onBackPressed: exit [DEBUG] Window: Window is closed normally. [INFO] Choreographer: Skipped 30 frames! The application may be doing too much work on its main thread. [INFO] TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null [WARN] TiApplication: (main) [281,281] Registering module with name already in use. [INFO] TiApplication: (main) [196,477] Analytics have been disabled [INFO] TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.miga.testcamera.Test_cameraActivity@58268ef [DEBUG] Window: Checkpoint: postWindowCreated() [INFO] Adreno: QUALCOMM build : 6933d31, I73c5708217 [INFO] Adreno: Build Date : 12/28/16 [INFO] Adreno: OpenGL ES Shader Compiler Version: XE031.09.00.04 [INFO] Adreno: Local Branch : [INFO] Adreno: Remote Branch : quic/LA.BR.1.3.6_rb1.11 [INFO] Adreno: Remote Branch : NONE [INFO] Adreno: Reconstruct Branch : NOTHING [WARN] IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection [ERROR] TiMedia: (main) [6826,6826] Camera preview is not open, unable to hide [INFO] Adreno: QUALCOMM build : 6933d31, I73c5708217 [INFO] Adreno: Build Date : 12/28/16 [INFO] Adreno: OpenGL ES Shader Compiler Version: XE031.09.00.04 [INFO] Adreno: Local Branch : [INFO] Adreno: Remote Branch : quic/LA.BR.1.3.6_rb1.11 [INFO] Adreno: Remote Branch : NONE [INFO] Adreno: Reconstruct Branch : NOTHING [INFO] Choreographer: Skipped 36 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 46 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 30 frames! The application may be doing too much work on its main thread. [INFO] Choreographer: Skipped 69 frames! The application may be doing too much work on its main thread. [WARN] InputMethodManager: com.miga.testcamera spent 1545ms to start processing msg:100 [WARN] IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection [INFO] Choreographer: Skipped 49 frames! The application may be doing too much work on its main thread. {noformat} also added a new video. The app restart is not required, it sometimes happens right away when I start the app for the first time, sometimes only after a few switching of apps.
Hello, Thanks for your feedback. Did you test using the sample code provided by us? I tested this issue and try to closed the app and reopened it took 4/5 more images and then it works as expected. Can you please share your environment details ? I am using SDK 7.4.0.GA and Huawei Y9 2018(Android 8) for testing.
As you hopefully saw in the last video I was testing your code. My details:
HTC A9, 7.0
Hello [~michael], I tested the sample code provided by [~rmitro], I wasn't able to reproduce the issue as you described. For me, and Rakhi the app works as expected before and after closing and reopening the app. I am able to see the same behavior after the app reopens. Each time after taking the image the image is shown in the window. No red screen (like the first open). I am testing on Nokia 6 (Android 8.1.0). Can you confirm this on any Android 8 version? We need to make sure this is happing in lower version than Android 8. Thanks.