[ 
https://issues.apache.org/jira/browse/CB-13781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16326587#comment-16326587
 ] 

ASF GitHub Bot commented on CB-13781:
-------------------------------------

infil00p commented on issue #308: CB-13781: (android) Fixed permissions request 
on Android 8 to save a …
URL: 
https://github.com/apache/cordova-plugin-camera/pull/308#issuecomment-357795338
 
 
   Not sure why iOS failed, since you didn't touch it, but yeah, this looks 
good to me and I can repo the bug, so I'll merge this in once I test locally.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


> Error requesting permission on Android 8 - Save on photo album issue
> --------------------------------------------------------------------
>
>                 Key: CB-13781
>                 URL: https://issues.apache.org/jira/browse/CB-13781
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-camera
>            Reporter: Rubén Panadero
>            Priority: Critical
>
> Google has changed how an android application must request permissions on 
> Android 8. In fact, it is considered as fix by Google due to a wrong behavior 
> on previous versions.
> Related documentation:
> [https://developer.android.com/about/versions/oreo/android-8.0-changes.html#rmp]
> This change made by Google has affected the cordova-camera-plugin. To save a 
> photo in Photo Album, the plugin just requests the READ_EXTERNAL_STORAGE 
> permission right now, but that is not enough on Android 8 because the plugin 
> writes the photo file into Pictures folder so it has to request the writing 
> permission, which is missing, as well.
> This is the error that the plugin throws when a photo is tried to be saved 
> into the photo album on Android 8.
> > 01-12 11:38:16.757 W/System.err(22321): java.io.FileNotFoundException: open 
> > failed: EACCES (Permission denied)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > android.os.ParcelFileDescriptor.openInternal(ParcelFileDescriptor.java:313)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > android.os.ParcelFileDescriptor.open(ParcelFileDescriptor.java:211)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1242)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > android.content.ContentResolver.openOutputStream(ContentResolver.java:1007)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > android.content.ContentResolver.openOutputStream(ContentResolver.java:983)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > org.apache.cordova.camera.CameraLauncher.writeUncompressedImage(CameraLauncher.java:979)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > org.apache.cordova.camera.CameraLauncher.writeUncompressedImage(CameraLauncher.java:1015)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > org.apache.cordova.camera.CameraLauncher.processResultFromCamera(CameraLauncher.java:603)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > org.apache.cordova.camera.CameraLauncher.onActivityResult(CameraLauncher.java:919)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:152)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:358)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > android.app.Activity.dispatchActivityResult(Activity.java:7235)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > android.app.ActivityThread.deliverResults(ActivityThread.java:4336)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > android.app.ActivityThread.handleSendResult(ActivityThread.java:4383)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > android.app.ActivityThread.-wrap19(Unknown Source:0)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1652)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > android.os.Handler.dispatchMessage(Handler.java:105)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > android.os.Looper.loop(Looper.java:164)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > android.app.ActivityThread.main(ActivityThread.java:6600)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > java.lang.reflect.Method.invoke(Native Method)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
> > 01-12 11:38:16.758 W/System.err(22321): at 
> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)
> To sum up, if the plugin has to save a photo in the photo album, this one has 
> to request both READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE permissions.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to