i have created a webview app for android studio. but didn't load the web url. the error is net::ERR_ACCESS_DENIED. can anyone help with this
For me the problem was a bit silly, I had originally forgot to add android:usesCleartextTraffic="true"
in the manifest and launched the app. After I added android:usesCleartextTraffic="true"
it still gave ERR_ACCESS_DENIED
. I then cleared the data, un-installed the app, re-installed it and bam, the error is gone.
Just started to develop android apps and got the same error even when I had permission:
<uses-permission android:name="android.permission.INTERNET"/>
Then I've uninstalled the app inside emulator and build again and now the app can access internet.
Try add these to your webview code:
webView.getSettings().setAllowContentAccess(true);
webView.getSettings().setAllowFileAccess(true);
If it still doesn't work, try add android:usesCleartextTraffic="true"
to your application tag in your manifest.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With