cordova-plugin-inappbrowser icon indicating copy to clipboard operation
cordova-plugin-inappbrowser copied to clipboard

Access Denied when open file in system storage

Open khoailangdo opened this issue 5 years ago • 11 comments

Bug Report

in my application. I use the InAppBrowser plugin to display files loaded from an API on the device memory. But when displaying (Photo) file from device memory, the error is displayed as follows:

`Webpage not available

The webpage at file:///storage/emulated/0/Android/data/com.kbd.bc/test.jpg could not be loaded because: net::ERR_ACCESS_DENIED `

I checked that the file "test.jpg" in the device memory still exists and can be opened in another photo viewer. Also I have applied for android permision permissions: <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

In addition I also go to the android Apps settings to allow the Storage permission to this App but also cannot display the image. But when I run the application on Simulator and LDPlayer4 Simulator, the image is displayed well and there is no error.

Please help me out with what errors are and what can be done to fix them?

Version information

What are relevant versions you are using? InAppBrowser plugin: 4.0.0 Cordova: 9.0.0 Ionic: 1.7.16 NodeJs: v6.11.5 Mobile Device OS: Android 8.0

Checklist

  • [x ] I searched for existing GitHub issues
  • [ ] I updated all Cordova tooling to most recent version
  • [x ] I included all the necessary information above

khoailangdo avatar Oct 15 '20 10:10 khoailangdo

Hi. I have the same issue. Did you find any solution ? Thanks

tdfeslo avatar May 25 '21 20:05 tdfeslo

Same problem here? Do you have any solution?

monavari-lebrecht avatar Jul 08 '21 15:07 monavari-lebrecht

Were you able to resolve this? I am encountering the same problem.

boringdeveloper avatar Jul 27 '21 07:07 boringdeveloper

I'm having the same issue. were you able to find a fix?

casper123 avatar Aug 14 '21 12:08 casper123

@khoailangdo were you able to solve this issue?

casper123 avatar Aug 15 '21 13:08 casper123

Try following the suggestions from this page. https://stackoverflow.com/questions/5899087/android-webview-localstorage

khoailangdo avatar Aug 15 '21 14:08 khoailangdo

I found this SO question to be more relevant, if the underlying cause is more related to targeting Android API level 30: https://stackoverflow.com/questions/63830399/android-webview-load-from-internal-storage-android-11-android-r

chrisjdev avatar Sep 09 '21 16:09 chrisjdev

I'm having the same issue while opening local image(file://../../test.jpg).

net::ERR_ACCESS_DENIED

It stops working when I upgraded cordova-android to 10.1.1. As far as I can see latest cordova-android plugin uses Android API level 30. Is there any workaround for this?

viktor-shmigol avatar Oct 14 '21 13:10 viktor-shmigol

Getting the same error as well. Any workaround would be helpful.

KoutrosK avatar Oct 14 '21 13:10 KoutrosK

I see that cordova-plugin-whitelist was moved into the core Cordova Android package and the plugin is compatible with cordova-android 4.0< to <10.X, could any changes here cause this?

walkerfirminibm avatar Nov 16 '21 21:11 walkerfirminibm

The solution it was implement on this pull: https://github.com/apache/cordova-plugin-inappbrowser/pull/883, but not merged yet. 😢

quenis avatar Nov 19 '21 18:11 quenis