You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/10/21 07:07:22 UTC

[GitHub] [cordova-plugin-camera] gerardoemr opened a new issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

gerardoemr opened a new issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679


   # Bug Report 
   
   ## Problem
   
   App crashes when using [Timestamp app](https://play.google.com/store/apps/details?id=com.jeyluta.timestampcamerafree&hl=es_MX&gl=US)  to take a picture.
   
   ### What is expected to happen?
   
   App should inform that the URI is not accessible by app, not crash.
   
   I have tried converting the "content://media/<path>" into a "file://<path>" without succes.
   
   I verified all permissions and the function works fine when using device's camera.
   
   ### What does actually happen?
   App is killed by OS...
   
   Log from `adb logcat`
   `10-20 23:27:29.354 13405 13405 E AndroidRuntime: FATAL EXCEPTION: main
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: Process: io.gits.form, PID: 13405
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=34, result=-1, data=null} to activity {io.gits.form/io.gits.form.MainActivity}: android.app.RecoverableSecurityException: io.gits.form has no access to content://media/external/images/media/6625
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.app.ActivityThread.deliverResults(ActivityThread.java:5097)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.app.ActivityThread.handleSendResult(ActivityThread.java:5138)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2147)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:107)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:237)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7814)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: Caused by: android.app.RecoverableSecurityException: io.gits.form has no access to content://media/external/images/media/6625
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.app.RecoverableSecurityException$1.createFromParcel(RecoverableSecurityException.java:197)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.app.RecoverableSecurityException$1.createFromParcel(RecoverableSecurityException.java:194)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.os.Parcel.readParcelable(Parcel.java:2990)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.os.Parcel.createException(Parcel.java:2083)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:2056)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:188)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.content.ContentProviderProxy.delete(ContentProviderNative.java:553)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.content.ContentResolver.delete(ContentResolver.java:1956)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at org.apache.cordova.camera.CameraLauncher.checkForDuplicateImage(CameraLauncher.java:1234)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at org.apache.cordova.camera.CameraLauncher.cleanup(CameraLauncher.java:1200)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at org.apache.cordova.camera.CameraLauncher.processResultFromCamera(CameraLauncher.java:601)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:806)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:159)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:361)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.app.Activity.dispatchActivityResult(Activity.java:8292)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	at android.app.ActivityThread.deliverResults(ActivityThread.java:5090)
   10-20 23:27:29.354 13405 13405 E AndroidRuntime: 	... 11 more
   10-20 23:27:29.365 22238 22238 D ActivityThread: setConscryptValidator
   10-20 23:27:29.366 22238 22238 D ActivityThread: setConscryptValidator - put
   10-20 23:27:29.369  4678  6839 I ActivityManager: DSS OFF for com.samsung.android.bixby.service
   10-20 23:27:29.386  4243  7458 I CameraService: onUidStateChanged: uid=10024, procState=4`
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   
   `
   takePicture(fieldId){
       console.log("Taking picture...");
       this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.CAMERA).then( 
         response => {
           console.log("Permission status:", response);
           console.log("Resolving file path...");
           this.camera.getPicture().then( uriPath => {
             this.fileCordova.resolveLocalFilesystemUrl(uriPath).then( resultPath => {
               console.log(resultPath);
             }).catch(error => console.log(error));
         }, err => {console.log(err)})
     }, err => {console.log(err)}
     )
   }
   `
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   
   Bug occurs on different Android 9+ devices.
   
   ### Version information
   
   `ionic info`
   Ionic:
   
      Ionic CLI                     : 5.4.9 (/usr/local/lib/node_modules/ionic)
      Ionic Framework               : @ionic/angular 5.0.0
      @angular-devkit/build-angular : 0.803.24
      @angular-devkit/schematics    : 8.3.25
      @angular/cli                  : 8.3.25
      @ionic/angular-toolkit        : 2.1.2
   
   Cordova:
   
      Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
      Cordova Platforms : android 7.1.0, browser 6.0.0
      Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 15 other plugins)
   
   Utility:
   
      cordova-res : not installed
      native-run  : 1.2.1 (update available: 1.2.2)
   
   System:
   
      NodeJS : v14.2.0 (/home/gerardo/.nvm/versions/node/v14.2.0/bin/node)
      npm    : 6.14.4
      OS     : Linux 5.4
   
   
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   
   
   I'm trying to retrieve plugin callback as mentioned in :
   https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#upgrading   (Last section)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] LeonardoMoliveira commented on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
LeonardoMoliveira commented on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-729098250


   same problem here, fixed temporarily with @breautek solution, and there is no fix for Android 11... :(


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] gerardoemr commented on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
gerardoemr commented on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-713581793


   You're right, downgrading to `android-targetSdkVersion = 28` stopped the app from crashing and is working as before. 
   
   The app needs to be published eventually, do you think trying out the [cordova-custom-config](https://www.npmjs.com/package/cordova-custom-config) to try to access the content URI is worth the try? 
    
   Thanks for the help!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] interstellerS commented on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
interstellerS commented on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-830105373


   the last Time i published , the Ionic APK to play store , I Got this warning : 
   
   > From May 5, you will need to tell us why your app requires extended storage access
   We have detected the requestLegacyExternalStorage flag in the manifest file of one or more of your app's app bundles or APKs.
   Developers whose apps are running on Android 11 or later should make use of siled storage space so that users can better control access to their device's storage space. As of May 5, to offer your app on Android 11 or later, you will need to follow one of the procedures below:
   Update your application to follow best practices that are more respectful of confidentiality, for example thanks to the Storage Access Framework or Media Store APIs
   Update your application to declare permission to access all files (MANAGE_EXTERNAL_STORAGE) in the manifest file, and complete the permission to access all files statement in the Play Console from May 5th
   Remove permission to access all files in your app
   For apps targeting Android 11, the requestLegacyExternalStorage flag will be ignored. You must use the All Files Access permission to maintain extended access.
   Apps that ask for permission to access all files when they are not allowed to do so will be removed from Google Play, and you will not be able to update them.
   
   In my Case , I commented the code line that crash the Plugin in a fork branch (https://github.com/interstellerS/cordova-plugin-camera/commit/884ff37f9ef68d40ca464a70b0e39b4adfde4f4b ) , Then both the image capture and save to gallery worked just Fine!
   
   I wonder if the entrerpise version of this plugin has a fix for this .
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] breautek commented on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-779398272


   > @breautek Do you know when we will have any informations about this Android 11 problem and Cordova? Is someone working on this?
   
   Afaik, no one is allocating time on API 30 FS problems. We need to figure out how to incorporate the [MediaStore](https://developer.android.com/reference/android/provider/MediaStore) APIs for API 30.
   
   MediaStore API is significantly different than the raw file system APIs so it may be out of scope for the file plugin itself. Someone needs to analyse this problem in great detail to understand the full scope of the problem (i.e: it obviously it affects the file system usage, but does it also affect this camera plugin? file transfer plugin? media-capture plugin? etc...). Based on this ticket, the answer to each of those questions is probably a "yes". Help is wanted for this.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] Houdhey commented on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
Houdhey commented on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-830065438


   > Google play store will not allow publishing ionic applications with `android:requestLegacyExternalStorage:true` 5 Mai .
   > 
   > Are there any alternative solution to keep this plugin work ? Or use another Similar one.
   
   Could you give me the source of this information please?  Thank you.
   This is gonna be problematic, please maintainers inform us about changes to come


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] LucasBourgeois edited a comment on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
LucasBourgeois edited a comment on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-960721533


   Hi, 
   Im having this issue too but it seems to be caused by the device itself as it tested my app and the camera.takePicture feature on many different devices all on android 10.. (even a fairPhone is working well).
   It's working also well on android 9, 11 and 12.
   
   Im ​having this issue with a Lenovo tab.
   
   Using the requestLegacyFileStorage flag is not an option as targetting api level 30 is mandatory.
   I should probably try to upgrade to v6 of this plugin but needs to upgrade cordova-android to > 10 also and it's quit scary and cause many other bugs for me.
   
   And as it's working well on most device, I believe thats i do not really need to upgrade the plugin version.
   
   Somebody have a workaround ?
   
   Its seems to crash on the checkForDuplicate function in cameraLuncher.java when trying to delete the image using the uri...
   
   im quite hopeless as im starting to change the java file for debugging ....
   
   Thx in advance
   
   Edit : Copy of my logcat :
   
   ```
   Caused by: android.app.RecoverableSecurityException: com.xxx.xxx has no access to content://media/external/images/media/25
           at android.app.RecoverableSecurityException$1.createFromParcel(RecoverableSecurityException.java:197)
           at android.app.RecoverableSecurityException$1.createFromParcel(RecoverableSecurityException.java:194)
           at android.os.Parcel.readParcelable(Parcel.java:2973)
           at android.os.Parcel.createException(Parcel.java:2066)
           at android.os.Parcel.readException(Parcel.java:2039)
           at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:188)
           at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
           at android.content.ContentProviderProxy.delete(ContentProviderNative.java:553)
           at android.content.ContentResolver.delete(ContentResolver.java:1949)
           at org.apache.cordova.camera.CameraLauncher.checkForDuplicateImage(CameraLauncher.java:1234)
           at org.apache.cordova.camera.CameraLauncher.cleanup(CameraLauncher.java:1200)
           at org.apache.cordova.camera.CameraLauncher.processResultFromCamera(CameraLauncher.java:597)
           at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:829)
           at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:159)
           at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:368)
           at android.app.Activity.dispatchActivityResult(Activity.java:8170)
           at android.app.ActivityThread.deliverResults(ActivityThread.java:4870)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] gerardoemr edited a comment on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
gerardoemr edited a comment on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-713581793


   You're right, downgrading to `android-targetSdkVersion = 28` stopped the app from crashing and is working as before. 
   
   The app needs to be published eventually, do you think trying out the [cordova-custom-config](https://www.npmjs.com/package/cordova-custom-config) to try to access the content URI is worth the try?  (I will also try the master branch of  `cordova-plugin-file`  )
    
   Thanks for the help!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] breautek commented on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-713545813


   If you're targeting android target 30, I'll downgrade for the time being. There are breaking changes in the android filesystem APIs that Cordova doesn't currently support. You can downgrade the target API via `android-targetSdkVersion` preference.
   
   If you're targeting android target 29, then I'd either downgrade to API 28* using the preference noted above or try the `master` branch of `cordova-plugin-file` (for testing purposes).
   
   * Note: If you're building a new app, Google won't allow you to publish an app build with API 28. If you're updating an existing app, Google will allow API 28 until November, which is creeping up fast.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] LucasBourgeois commented on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
LucasBourgeois commented on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-960721533


   Hi, 
   Im having this issue too but it seems to be caused by the device itself as it tested my app and the camera.takePicture feature on many different devices all on android 10.. (even a fairPhone is working well).
   It's working also well on android 9, 11 and 12.
   
   Im ​having this issue with a Lenovo tab.
   
   Using the requestLegacyFileStorage flag is not an option as targetting api level 30 is mandatory.
   I should probably try to upgrade to v6 of this plugin but needs to upgrade cordova-android to > 10 also and it's quit scary and cause many other bugs for me.
   
   And as it's working well on most device, I believe thats i do not really need to upgrade the plugin version.
   
   Somebody have a workaround ?
   
   Its seems to crash on the checkForDuplicate function in cameraLuncher.java when trying to delete the image using the uri...
   
   im quite hopeless as im starting to change the java file for debugging ....
   
   Thx in advance


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] Houdhey commented on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
Houdhey commented on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-779392976


   @breautek Do you know when we will have any informations about this Android 11 problem and Cordova? Is someone working on this?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] rejneesh1 commented on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
rejneesh1 commented on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-779286798


   Any solution found for android 11


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] LucasBourgeois edited a comment on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
LucasBourgeois edited a comment on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-960721533


   Hi, 
   Im having this issue too but it seems to be caused by the device itself as it tested my app and the camera.takePicture feature on many different devices all on android 10.. (even a fairPhone is working well).
   It's working also well on android 9, 11 and 12.
   
   Im ​having this issue with a Lenovo tab.
   
   Using the requestLegacyFileStorage flag is not an option as targetting api level 30 is mandatory.
   I should probably try to upgrade to v6 of this plugin but needs to upgrade cordova-android to > 10 also and it's quit scary and cause many other bugs for me.
   
   And as it's working well on most device, I believe thats i do not really need to upgrade the plugin version.
   
   Somebody have a workaround ?
   
   Its seems to crash on the checkForDuplicate function in cameraLuncher.java when trying to delete the image using the uri...
   
   im quite hopeless as im starting to change the java file for debugging ....
   
   Thx in advance
   
   Edit : Copy of my logcat :
   
   `Caused by: android.app.RecoverableSecurityException: com.xxx.xxx has no access to content://media/external/images/media/25
           at android.app.RecoverableSecurityException$1.createFromParcel(RecoverableSecurityException.java:197)
           at android.app.RecoverableSecurityException$1.createFromParcel(RecoverableSecurityException.java:194)
           at android.os.Parcel.readParcelable(Parcel.java:2973)
           at android.os.Parcel.createException(Parcel.java:2066)
           at android.os.Parcel.readException(Parcel.java:2039)
           at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:188)
           at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
           at android.content.ContentProviderProxy.delete(ContentProviderNative.java:553)
           at android.content.ContentResolver.delete(ContentResolver.java:1949)
           at org.apache.cordova.camera.CameraLauncher.checkForDuplicateImage(CameraLauncher.java:1234)
           at org.apache.cordova.camera.CameraLauncher.cleanup(CameraLauncher.java:1200)
           at org.apache.cordova.camera.CameraLauncher.processResultFromCamera(CameraLauncher.java:597)
           at org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:829)
           at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:159)
           at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:368)
           at android.app.Activity.dispatchActivityResult(Activity.java:8170)
           at android.app.ActivityThread.deliverResults(ActivityThread.java:4870)`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] gerardoemr edited a comment on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
gerardoemr edited a comment on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-713581793


   You're right, downgrading to `android-targetSdkVersion = 28` stopped the app from crashing and is working as before. 
   
   The app needs to be published eventually, do you think trying out the [cordova-custom-config](https://www.npmjs.com/package/cordova-custom-config) to try to access the content URI is worth the try?  (I will also try the master branch )
    
   Thanks for the help!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] interstellerS commented on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
interstellerS commented on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-830029983


   Google play store will not allow publishing ionic applications with  `android:requestLegacyExternalStorage:true` 5 Mai .
   
   Are there any alternative solution to keep this plugin work ? Or use another Similar one. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] jkorrek commented on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
jkorrek commented on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-924763509


   From what I can tell, taking a picture with this plugin might always add the picture to the phones gallery (=MediaStore), even if `saveToPhotoAlbum` is `false`. I think that this is related to camera app that used on the phone, but I am not completely sure about that.
   
   The deletion of files in the MediaStore changed with the Scoped Storage changes introduced in SDK 29.
   As far as I can tell, deletion will only be possible if the user manually approves the modification.
   
   In SDK 29 this permission may be requested via the RecoverableSecurityException. Starting from SDK 30, a delete request can be created.
   
   You can find a simple implementation for this here: https://github.com/jkorrek/cordova-plugin-camera/blob/sdk-30-deletion/src/android/CameraLauncher.java#L1267
   
   As I am not sure if I want to bother our users with this deletion request, I also added a flag to explicitly activate this behaviour. 
   
   For Android 10 / SDK 29 the confirmation request show to the user will look like this:
   ![deletion_confirmation](https://user-images.githubusercontent.com/7962396/134319587-33c6350c-44a1-442c-92dd-e8eb630ad464.png)
   
   I wasn't able to test this for Android 11 / SDK 30 yet.
   
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] breautek commented on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-713605565


   With API 29, you'll need https://github.com/apache/cordova-plugin-file/pull/417/files which the `cordova-plugin-file` has, but is not released yet.
   
   So if you can add the `android:requestLegacyExternalStorage` flag using the `cordova-custom-config` plugin, then that could be a workaround for the time being.
   
   The `android:requestLegacyExternalStorage` is only introduced in API 29 and will be ignored in API 30, forcing app developers to actually use the new FS system that android has.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] rejneesh1 edited a comment on issue #679: App crashes with RecoverableSecurityException after URI resolves to content://media/

Posted by GitBox <gi...@apache.org>.
rejneesh1 edited a comment on issue #679:
URL: https://github.com/apache/cordova-plugin-camera/issues/679#issuecomment-779286798


   Any solution found for android 11?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org