我构建了一个网络应用程序,想创建一个android应用程序,它有一个显示我的网络应用程序的网络视图.在按照谷歌开发者的指示创建了一个应用程序后,我成功地用安卓5.1.1在我的手机上安装了它.
然而,当我第一次运行该应用程序时,网页视图显示以下消息:
网页不可用
无法将[Lorem Ipsum URL]上的网页加载为:
net::ERR_CACHE_MISS
我构建了一个网络应用程序,想创建一个android应用程序,它有一个显示我的网络应用程序的网络视图.在按照谷歌开发者的指示创建了一个应用程序后,我成功地用安卓5.1.1在我的手机上安装了它.
然而,当我第一次运行该应用程序时,网页视图显示以下消息:
网页不可用
无法将[Lorem Ipsum URL]上的网页加载为:
net::ERR_CACHE_MISS
答案集合!我只是想把所有的答案合并成一个综合答案.
1.判断manifest.xml
中是否有<uses-permission android:name="android.permission.INTERNET" />
.Make sure that it is nested under 104 and not 105.多亏了sajid45和Liyanis Velazquez
2.确保您使用的是<uses-permission android:name="android.permission.INTERNET"/>
,而不是过时的<uses-permission android:name="android.permission.internet"/>
.非常感谢alan_shi和creos.
3.如果最低版本低于KK,请判断
if (18 < Build.VERSION.SDK_INT ){
//18 = JellyBean MR2, KITKAT=19
mWeb.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
}
或
if (Build.VERSION.SDK_INT >= 19) {
mWebView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
}
因为只有在KK(SDK 19)中才添加了正确的webview.多亏了Devavrata、Mike ChanSeong Kim和Liyanis Velazquez
4. Ensure that you don't have webView.getSettings().setBlockNetw或kLoads (false);
. Thanks to TechNikh f或 pointing this out.
5. If all else fails, make sure that your Android Studio, Android SDK and the emulat或 image (if you are using one) is updated. And if you are still meeting the problem, just open a new question and make a comment below to your URL.