'net::ERR_ACCESS_DENIED (file:///data/user/0/packagename/files/appname/app_id/idex.html) in android

We have updated android target version from 29 to 30 due to play store app publish issue. From our android app We are trying to load in a html file in web view.at the time we are facing below issue.

net::ERR_ACCESS_DENIED (file:///data/user/0/packagename/files/appname/app_id/idex.html)

at the same time I reverted back the target version to 29. It was working fine and html was loading properly.



Solution 1:[1]

You can add these for the webview and try.

webView.getSettings().setAllowUniversalAccessFromFileURLs(true);
webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setAllowContentAccess(true);
webView.getSettings().setAllowFileAccess(true);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Arkaprabha Mahata