-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera Plugin crashes the APP on android 9 #479
Comments
I have the same problem, can anyone help? |
Is this reproducible in a new, plain Cordova app? A minimal reproduction repository would really help to debug and later fix this issue. More information on how to create one: https://github.com/apache/cordova-contribute/blob/master/create-reproduction.md |
@timbru31 yes this is reproducible, the app launches the black camera view with the crash pop up on invoking the getPicture() function. My test device is Samsung Galaxy s9 running Android 9. |
@abhinavkumar-utsa can you zip up an android project where this bug occurs and put it up |
did this get solved? |
Any updates? |
Not exactly clear based on the provided log, but one reason an activity could be stopped is due to this android quirk
This isn't a crash, however the webview will lose it's state and therefore likely load up your default view. It's up to the developer to handle this case and save the application state somewhere where it can be restored. |
@breautek We are a bit puzzled this is still the case in 2020 with Android phones more powerful than a laptop. |
Having lots of ram doesn't mean an individual app can allocate all of said ram. Many phones only allows limited quota to the ram. Additionally, the camera app is also ram heavy (relatively speaking), due to its processing of a very large resolution image/video.
Again different phones have different specs, and different screen resolutions, and different vendors, all with different ram requirements and probably different ram management. These older devices while they may of had less RAM, they also had much less screen resolution and image resolution images and thus also required less ram to process and overall may actually be less stressful on the ram on the phones. To be clear, I'm not claiming that this issue is due to the android quirk, but I am saying it is a possibility. The given log information shows no crash stacktrace, but it does show the app went into a paused state, then later was killed, so this behaviour does match the android quirk. One quick and easy way to test this is to actually listen to the If there is a |
I had an issue with the camera on any snapdragon device. I found replacing the default camera app with just about any other one from the playstore fixed it. I have tested Open Camera. So I suspect there is an issue in the camera app itself caused somehow by qualcomm. |
Allocated ram increases with screen resolution on Android https://drive.google.com/file/d/0B7Vx1OvzrLa3Y0R0X1BZbUpicGc/view We are facing the issue also on old devices after upgrading to Android 9. With the same app, we are able to shoot 4K videos ( |
Bug Report
Log cat snippet
07-12 17:14:04.884 1312-1483/in.test.app D/SERVER: Handling local request: http://localhost/svg/md-camera.svg
07-12 17:14:06.114 1312-1585/in.test.app I/Timeline: Timeline: Activity_launch_request time:1083912826 intent:Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 clip={text/uri-list U:content://in.test.app.provider/external_files/Android/data/in.test.app/cache/.Pic.jpg} (has extras) }
07-12 17:14:06.126 1312-1312/in.test.app D/CordovaActivity: Paused the activity.
07-12 17:14:06.127 1312-1585/in.test.app W/PluginManager: THREAD WARNING: exec() call to Camera.takePicture blocked the main thread for 42ms. Plugin should use CordovaInterface.getThreadPool().
07-12 17:14:06.128 1312-1312/in.test.app I/com.tenforwardconsulting.bgloc.cordova.BackgroundGeolocationPlugin: App will be paused multitasking=true
07-12 17:14:06.215 1312-1312/in.test.app I/com.marianhello.bgloc.service.LocationServiceImpl: Creating LocationServiceImpl
07-12 17:14:06.254 1312-1312/in.test.app I/com.marianhello.bgloc.PostLocationTask: Creating PostLocationTask
07-12 17:14:06.262 1312-1895/in.test.app I/com.marianhello.bgloc.service.LocationServiceImpl: Network condition changed has connectivity: true
07-12 17:14:06.273 1312-1312/in.test.app D/com.marianhello.bgloc.service.LocationServiceImpl: Service in [NOT STARTED] state. cmdId: [3]. startId: [1]
07-12 17:14:07.228 1312-1312/in.test.app D/CordovaActivity: Stopped the activity.
07-12 17:14:07.229 1312-1312/in.test.app I/com.tenforwardconsulting.bgloc.cordova.BackgroundGeolocationPlugin: App is no longer visible
Problem
Camera plugin crashes the App on getPicture
What is expected to happen?
we should get the image back
What does actually happen?
app crashes
Information
ionic 4
Android 9
Xiomi Mi 6 Pro device
Command or Code
Environment, Platform, Device
ionic 4
Android 9
Xiomi Mi 6 Pro device
Version information
The text was updated successfully, but these errors were encountered: