On Android 9 (Api 29) am trying to load a url and i get the error "The webpage at url could not be loaded because: net::ERR_ACCESS_DENIED".
I have internet the internet permission in the AndroidManifest.xml
files
<uses-permission android:name="android.permission.INTERNET" />
From logcat, i can see the the following error as well :
E/chromium: [ERROR:socket_posix.cc(94)] CreatePlatformSocket() failed: Operation not permitted (1)
My code is as follows :
WebView webView = findViewById(R.id.webView);
webView.loadUrl("https://andela.com/alc/");
I later added the following code to get more detail :
webView.setWebViewClient(new WebViewClient(){
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
super.onReceivedError(view, request, error);
Log.d("TAG", error.getDescription().toString());
// handler.proceed(); This line wont make a different on API 29, Webview still bank
}
});
The Webview loads the url properly when using an emulator running API 25. Also tested on API 28 and it works fine. Only doesn't work on API 29.
You might often face issues in updating the chrome and Android System Webview. To fix this problem, you can reboot your device, check your internet connection, stop auto-updating all apps, clear Google Playstore cache, and storage, leave the beta testing program, and manually update Android WebView app from Playstore.
Alternatives to WebView If you want to send users to a mobile site, build a progressive web app (PWA). If you want to display third-party web content, send an intent to installed web browsers. If you want to avoid leaving your app to open the browser, or if you want to customize the browser's UI, use Custom Tabs.
You may get this "ERR_UNKNOWN_URL_SCHEME error" during mailto: or tel: links inside an iframe. To solve it, try to add target="_blank" in your URL Scheme/Code.
just uninstall the app and once again install it.That work 100%
In my case the web page becomes loading correctly (without ERR_ACCESS_DENIED
) after changing applicationId
in build.gradle
(and run the app, of-course). After that you may return the old applicationId
.
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