Android Webview gives net::ERR_CACHE_MISS message

2019-01-22 05:27发布

I built a web app and wants to create an android app that has a webview that shows my web app. After following the instructions from Google Developer to create an app, I successfully installed it on my phone with Android 5.1.1.

However, when I run the app for the first time, the webview shows the message:

Web page not available

The Web page at http://www.google.com.sg could not be loaded as:

net::ERR_CACHE_MISS

After searching for a while on Google and trying out solutions, I am still stuck on this error. I have included all permissions needed so it shouldn't be beacuse of that. My Android Studio is also fully updated so it is not because of that.

4条回答
看我几分像从前
2楼-- · 2019-01-22 05:44

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);
}
查看更多
甜甜的少女心
3楼-- · 2019-01-22 05:49

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" />
查看更多
混吃等死
4楼-- · 2019-01-22 05:51

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"/>

查看更多
5楼-- · 2019-01-22 05:55

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

查看更多
登录 后发表回答