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:
us...@infra.apache.org



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

Reply via email to