-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Cordova-plugin-camera crashes app on android devices #660
Comments
I have same problem here for version 4.2. |
@charlieshin @lanadedstudio can you both try with the latest camera plugin release? I have just released a few hours ago version 5.0.0. You should be able to use the latest just by removing and readding.
Sorry, I should also note that the latest release also required Cordova-Android platform |
I am having a similar issue where when I take a picture with the new version |
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 |
Just checked with a fresh cordova app, also fails there. If I have editing enabled, it says editing isn't allowed, and if I disable it it just sends out a |
Can you test with In my experience, Alternatively, you could also try resizing the image using the
I'm not convinced this is the same issue as the OP described. You're describing an error case, where the OP is describing a crash (which I may be falsely interpreting that the app is closing unexpectedly). You may want to create a new issue so that we can track the issue you described independently. |
I will test with the new version! TKS I'm using the android version 8.1.0 because i'm building my app with Monaca and them requires this version... but i will try update android too |
@lanadedstudio is this issue still happening with the latest released version? If not, feel free to close this issue. |
Yes, this continues to happen on some devices. Even with the updated plugin and using FILE_URI instead of DATA_URL. |
Are you able to provide a stacktrace of the crashes? |
After updating the plugin, the photos with the front camera are working, but the photos with the back camera still close the application. I removed the option to allow image editing. I also tested it with another camera app and it worked. |
hey guys: I was using version 4.2.0 and it was working well. Now I'm trying to install this version again and I'm not been able. What did happen to version 4.2.0 ? |
Version 4.2.0 was never released because it contained #588 which broke some things on Android. |
ok! thanks a lot. |
Hi, is there any update on this issue ? I'm using the plugin v5.0.1 and the app still crashes after taking a photo with the back camera |
Are you able to provide a stacktrace of the crashes? |
@PieterVanPoyer sorry for the late reply, this is what I got from the log
Btw I tested it with the front camera and it logged the same error. Cordova-plugin-camera : v.5.0.1 |
This plugin likely doesn't handle API 29/30 changes to external storage. There should be potential two workarounds for the time being:
Adding this to your <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:requestLegacyExternalStorage="true" />
</edit-config> Note:
|
@breautek thank you for your help. now it works as expected |
@lanadedstudio is this issue still occuring with the latest Cordova and Cordova plugins versions? |
Yes, the problem persists Cordova Version: 10.00 I recently tested the error on smartphone models: Smartphone Model: Moto G7 Play Smartphone Model: Asus_X00TDB When I installed an external camera app (not the android camera) it worked normally. |
will this work with cordova-android 10.0.0 |
The PR mentioned in my comment has been merged. You can give it a test by installing this plugin from github. cordova-android@10 is required as it contains breaking changes making it incompatible with cordova-android@9. |
I confirm that upgrading to 6.0.0 along side updgrading to cordova 10 and cordova-android 10 works in our project. Nb : If you upgrade cordova from 8 to 10, don't forget to add cordova-plugin-androidx-adapter plugin in your project, and verify gradle dependencies, in our case com.google.gms:google-services needs to be updated to 4.3.8. |
Device: Motorola E7 with 4 GB RAM My solution was install Open Camera and use this app to take photos from my Cordova App. Before Open Camera I was using the Motorola's Camera App that abruptly closes my app after I confirm a taken photo. |
Im still seeing some instances of this error on Android devices, even with the latest release of this plugin and Cordova-android
according to the Google Play Console, its happening on different devices on Android 13 |
Issue Type
Description
The app crashes when the photo is captured. Error checked on Android 9 and 10, on IOS works well
Information
Command or Code
Environment, Platform, Device
Version information
Cordova Packages:
Project Installed Platforms:
Project Installed Plugins:
Checklist
The text was updated successfully, but these errors were encountered: