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 2021/03/29 19:38:58 UTC

[GitHub] [cordova-plugin-camera] cvettelina opened a new issue #718: Crop not working on Android 10 and 11

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


   # Bug Report
   
   ## Problem
   With the latest versions crop functionality is not working on Android 10 and 11 (target SDK 29)
   
   ### What is expected to happen?
   Cropped image is delivered successfully
   
   
   ### What does actually happen?
   Crop throws an exception
   
   ## Information
   System.err: java.io.FileNotFoundException: /data/user/0/{app_name}/cache/1616872358512.jpg: open failed: ENOENT (No such file or directory) : Failed to UpdateQosForCgroupInner, tid=0, policy=10
    DecorView: showOrHideHighlightView: hasFocus=false; winMode=1; isMrgNull=true
    HwNetworkManagementService: code == CODE_SET_CHR_REPORT_APP_LIST
    System.err: 	at libcore.io.IoBridge.open(IoBridge.java:496)
    System.err: 	at java.io.FileInputStream.<init>(FileInputStream.java:159)
    System.err: 	at java.io.FileInputStream.<init>(FileInputStream.java:115)
    System.err: 	at android.media.ExifInterface.initForFilename(ExifInterface.java:2363)
   
   ### Environment, Platform, Device
   Android 10 and 11
   Cordova Android 9
   cordova-plugin-camera 5.0.1
   android:requestLegacyExternalStorage="true" is added to AndroidManifest.xml


-- 
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] Jeetuy edited a comment on issue #718: Crop not working on Android 10 and 11

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


   Hi @bilalsaeed  
   I am using allowEdit:"true" for cropping square and rectangle . As per requirement i need to crop text so facing issue cropping text like address in android 11. After cropping nothing is happing following your steps still facing same issue. 
   
   I also used cordova-plugin-crop plugin but its allowing square cropping not rectangular.
   
   Please help me ......Thanks
    


-- 
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] Jeetuy commented on issue #718: Crop not working on Android 10 and 11

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


   Hi @bilalsaeed  
   I am using allowEdit:"true" for cropping square and rectangle . As per requirement i need to crop text so facing issue cropping text like address in android 11. After cropping nothing is happing following your steps still facing same issue. 
   
   Please help me ......Thanks
    


-- 
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] bilalsaeed edited a comment on issue #718: Crop not working on Android 10 and 11

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


   I resolved the issue by changing the source code in CameraLauncher.java file, the issue is that android 11 does not allow access to URIs created from URI.fromFile from one application to another. For example, in the performcrop method we are generating a 
   `croppedUri = Uri.fromFile(createCaptureFile(this.encodingType, System.currentTimeMillis() + ""));`
   
   and passing it to other activity therefore the receiving application will not have access to the croppedUri and throws an error like Access Denied or Editing is not allowed for this image.
   
   So in order to resolve that we need to create a URI from FileProvider.getUriForFile().
   
   I know it may sound silly. but replace with the following.
   
   `croppedUri = picUri;`
   
   It worked for me on Android 10 and 11.
   
   Please let me know your thoughts.
   
   Thanks.


-- 
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] bilalsaeed commented on issue #718: Crop not working on Android 10 and 11

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


   Hi @Jeetuy 
   
   Please remove cordova camera pluging and add the one @alemit created. This may temporarily resolve your issue.
   
   Best,


-- 
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] p-caetano commented on issue #718: Crop not working on Android 10 and 11

Posted by GitBox <gi...@apache.org>.
p-caetano commented on issue #718:
URL: https://github.com/apache/cordova-plugin-camera/issues/718#issuecomment-813349413


   Same here. We had to disable crop (allowEdit: false) on Android as a workaround.


-- 
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] ishtiaqshariffTopdevz commented on issue #718: Crop not working on Android 10 and 11

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


   (allowEdit: false) also not working.


-- 
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] bilalsaeed edited a comment on issue #718: Crop not working on Android 10 and 11

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


   I resolved the issue by changing the source code in CameraLauncher.java file, the issue is that android 11 does not allow access to URIs created from URI.fromFile from one application to another. For example, in the performcrop method we are generating a 
   `croppedUri = Uri.fromFile(createCaptureFile(this.encodingType, System.currentTimeMillis() + ""));`
   
   and passing it to other activity therefore the receiving application will not have access to the croppedUri and throws an error like Access Denied or Editing is not allowed for this image.
   
   So in order to resolve that we need to create a URI from FileProvider.getUriForFile().
   
   I know it may sound silly. but replace with the following in performCrop method solved it for me.
   
   `croppedUri = picUri;`
   
   It worked for me on Android 10 and 11.
   
   Please let me know your thoughts.
   
   Thanks.


-- 
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] bilalsaeed commented on issue #718: Crop not working on Android 10 and 11

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


   I resolved the issue by changing the source code in CameraLauncher.java file, the issue is that android 11 does not allow access to URIs created from URI.fromFile from one application to another. For example, in the performcrop method we are generating a 
   `croppedUri = Uri.fromFile(createCaptureFile(this.encodingType, System.currentTimeMillis() + ""));`
   
   and passing it to other activity therefore the receiving application will not have access to the croppedUri and throws an error like Access Denied or Editing is not allowed for this image.
   
   So in order to resolve that just replace that line with the following:
   
   I know it may sound silly. but replace with the following.
   
   `croppedUri = picUri;`
   
   It worked for me on Android 10 and 11.
   
   Please let me know your thoughts.
   
   Thanks.


-- 
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] bilalsaeed edited a comment on issue #718: Crop not working on Android 10 and 11

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


   Hi @Jeetuy 
   
   Please remove cordova camera plugin and add the one @alemit created. This may temporarily resolve your issue.
   
   Best,


-- 
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] bilalsaeed commented on issue #718: Crop not working on Android 10 and 11

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


   Hi @brunoalex.
   
   I made that change in CameraLauncher.java file on line 441. I am attaching the file in this comment. Please also note that I am using 4.1.0 plugin. You also need to change path of camera plugin in config.xml and package.json files like the following
   Package.json:
   "cordova-plugin-camera": "./custom-plugins/cordova-plugin-camera-4.1.0",
   
   config.xml:
   <plugin name="cordova-plugin-camera" spec="./custom-plugins/cordova-plugin-camera-4.1.0">
       <variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
     </plugin>
   
   [CameraLauncher.txt](https://github.com/apache/cordova-plugin-camera/files/7569463/CameraLauncher.txt)
   .


-- 
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] bilalsaeed edited a comment on issue #718: Crop not working on Android 10 and 11

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


   Hi @brunoalex.
   
   I made that change in CameraLauncher.java file on line 441. I am attaching the file in this comment. Please also note that I am using 4.1.0 plugin. You also need to change path of camera plugin in config.xml and package.json files like the following
   
   Package.json:
   `
   "cordova-plugin-camera": "./custom-plugins/cordova-plugin-camera-4.1.0",`
   
   config.xml:
   
   ```
   <plugin name="cordova-plugin-camera" spec="./custom-plugins/cordova-plugin-camera-4.1.0">
       <variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
   </plugin>
   ```
   
   [CameraLauncher.txt](https://github.com/apache/cordova-plugin-camera/files/7569463/CameraLauncher.txt)


-- 
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] rawcoolpad commented on issue #718: Crop not working on Android 10 and 11

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


   I am also facing same problem in android 11. any solution....?


-- 
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] brunoalex commented on issue #718: Crop not working on Android 10 and 11

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


   hi @bilalsaeed can you elaborate on that ? where did you made the change ? on  CameraLauncher.java file ? in what line ? i can see there many croppedUri commands...


-- 
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] alemit commented on issue #718: Crop not working on Android 10 and 11

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


   The crop is working in my fork here https://github.com/alemit/cordova-plugin-camera by using the bilalsaeed initial hint + some more changes. It is compatible with android 30 target version. The config.xml is kind of deprecated already so in order to use it you would only need to add the cordova plugin out from the repository(e.g condova plugin add cordova-plugin-camera@git+https://github.com/alemit/cordova-plugin-camera.git)


-- 
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] fcsteenkamp commented on issue #718: Crop not working on Android 10 and 11

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


   Hi, 
   
   This issue has become a bit of a headache.
   
   Does anyone maybe know if this issue will be fixed in the next release?


-- 
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] rawcoolpad commented on issue #718: Crop not working on Android 10 and 11

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


   @p-caetano, I need crop function also.


-- 
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] satheeshkumartitan commented on issue #718: Crop not working on Android 10 and 11

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


   Anyone got a solution please update it, I too facing the same issue in the android 11 crash !!!...


-- 
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] fcsteenkamp commented on issue #718: Crop not working on Android 10 and 11

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


   Also have the same issue, but currently only on Android 11. Got it working on Android 10.
   
   **Environment**
   Cordova Android 9.0.0
   cordova-plugin-camera 4.1.0
   android:requestLegacyExternalStorage="true" is added to AndroidManifest.xml
   
   ` $scope.takePicture = function () {
               var options = {
                   quality: 85,
                   destinationType: Camera.DestinationType.DATA_URL,
                   sourceType: Camera.PictureSourceType.CAMERA,
                   allowEdit: true,
                   encodingType: Camera.EncodingType.JPEG,
                   targetWidth: 800,
                   targetHeight: 600,
                   popoverOptions: CameraPopoverOptions,
                   saveToPhotoAlbum: true
               };`
   


-- 
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