Android Webview gives net::ERR_CACHE_MISS message

 ̄綄美尐妖づ 提交于 2019-11-27 18:54:24
alan shi

I solved the problem by changing my AndroidManifest.xml.

old  : <uses-permission android:name="android.permission.internet"/>
new: <uses-permission android:name="android.permission.INTERNET"/>

Mike ChanSeong Kim

I tried above solution, but the following code help me to close this issue.

if (18 < Build.VERSION.SDK_INT ){
    //18 = JellyBean MR2, KITKAT=19
    mWeb.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
}
sajid45

For anything related to the internet, your app must have the internet permission in ManifestFile. I solved this issue by adding permission in AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />
zehata

I have found an answer to my problem. It was because I accidentally nested the permission in the application in AndroidManifest.xml.

@Bidhan Although I did not use what commented, thank you for your quick response

Also make sure your code doesn't have true for setBlockNetworkLoads

webView.getSettings().setBlockNetworkLoads (false);

Use

if (Build.VERSION.SDK_INT >= 19) {
        mWebView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
    }

It should solve the error.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!