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
Error Code 20 on Android #826
Comments
Please edit the post and provide the requested information in the form. Definitely include code snippets and version information. |
Good Morning @breautek, The same issue occurs in android 11 "Camera issue:20" to unable open the camera. Below I include the AndroidManifest.xml file for your reference. can you please help me to resolve this issue
|
Same error here. Here's my code. I'm upgrading my Ionic app (where selecting a photo from the gallery previously worked) to support API 33, using Cordova 12.0.0. I upgraded the camera plugin to 6.0.0, but still get error 20. I'm getting this error on Android 13.
|
Thx. |
same problem |
I'm experiencing the same issue. Running it works fine rolling back to these settings: changing the targetSdk to 32 without also setting android to 11 throws an error at build the ticking clock here is Google's targetSdk 33 requirement starting on Aug 31, 2023 EDIT: the fork by |
same here for me. Testing on Android 13.0.0 on a OnePlus 9 Pro (edit: I've tested another Android 13 device, the Google Pixel 7): I've tried the following repos and finally found a working one:
So I've solved the Issue for me by including |
Thx @cyril23 🔥 🙌 It also works on my Samsung S20, with Cordova 12, Android 13 API 33. |
glad to hear, but the https://github.com/jalios/cordova-plugin-camera/ fork still has some problems on an old X10302 tablet running Android 7.0.0. On that Android 7 device it is not the error 20 though:
The same storage permission problem exists on Android 8.1.0 too, on an old Nexus 5X (LG H791). edit: further information about the X10302 tablet running Android 7.0.0 and about my Nexus 5X (LG H791) running Android 8.1.0 |
I've created an app from zero and ran on an emulator with android 13, i was getting this error as well. Oddly enough, if i keep pressing the camera button multiples times really fast, it eventually opens the camera app (?!?) 😕 |
@cyril23 Here a fork inspired from the work of @jalios. Work perfectly on Android 13, 7 and 8 🎉 https://github.com/DaedalusDev/cordova-plugin-camera/ I've only change that rows to match original code : - boolean saveAlbumPermission;
- if (this.saveToPhotoAlbum) {
- saveAlbumPermission = hasPermissions(storagePermissions);
- } else {
- saveAlbumPermission = true;
- }
+ boolean saveAlbumPermission = hasPermissions(storagePermissions); I've also suggest that change in a sibling merge request (#814 https://github.com/apache/cordova-plugin-camera/pull/814/files#r1243650007) Good luck ! |
I'm using ionic 6 (capacitor 5).
That's a temporary solution, but better than nothing. |
Using Cordova the jalios branch works fine under Android 12 and 13 (didn't test others). |
Thanks a lot for your work! I've tested it, too on the following the devices - everything works perfectly:
yes, but I would recommend DaedalusDev' Branch on https://github.com/DaedalusDev/cordova-plugin-camera/ (I mean his merge request) because of its Android 7-8 downwards compability. |
By the way, the error 20 is still thrown if the camera permissions are not granted by the user (after requesting them by the app). So with the current plugin, after the app requesting the permissions...
Tested on Android 11 on a Newland NFT 10, I havn't tested any other devices or Android versions yet. |
+1 this is great. Need it merged! |
+1 would be cool to merge, thanks for the fix. |
+1 if you can prioritize this |
Please merge ASAP. |
I have tried ALL of these and still getting error 20 with API level 33 |
@TomPretorius check that ure really using the fork instead of the apache release. Yet, time limit is tomorrow and still no release of this fix... u can ask to google to delay the restriction a little bit (by 4 months if i remember right) and just have to wait the release of the fix.. Please consider to resolve and release a fix of this fast |
Make sure you remove the existing cordova-plugin-camera before you install the mentioned one. Thanks for the fix @cyril23 😍 |
Should be fixed by #844 |
@cyril23 error is gone but the new error came "no image selected", WhatsApp.Video.2023-09-21.at.14.39.34.-.Trim.mp4 |
not working with https://github.com/jalios/cordova-plugin-camera.git , camera not opening now. |
|
if u want to shift ur project to cordova-android 12
|
Use current release instead of the tip of master of the development branch which will be unstable. At the time of writing, there has been no commits between the current release and the master branch outside of chore commits (e.g. bumping to
This is overall simply bad advice
This will allow the Java heap to grow much larger than the standard 256mb the OS gives you. Garbage collection can be delayed and when GC does occur it can take a significantly longer time to accomplish leading to stuttering UI and poor app performance.
Today this is a no-op, it only applies if you're targeting API 29, and only applies if you had the app published before API 29 was released. Today, Google Play requires targeting API 33.
This should only be used in testing/development environments. Google expects you to be using secured traffic whenever possible so that your user data is properly secured. I've locked this thread to respect the OP's inbox, because it seems to be going off topic (e.g. we can't provide assistance if you're using a fork of this plugin). If there are issues with v7 of this plugin, I'd recommend raising a new issue with the details filled out so that it can be tracked and addressed accordingly. |
Bug Report
Problem
What is expected to happen?
What does actually happen?
Information
Command or Code
Environment, Platform, Device
Version information
Checklist
The text was updated successfully, but these errors were encountered: