首页 > 解决方案 > net::ERR_CACHE_MISS react-native-webview on Android 5

问题描述

打开 WebView

 <WebView
   onNavigationStateChange={handleURL}
   style={[styles.webView, !loading && { display: "none" }]}
   source={{
     uri: "https://google.com"
   }}
 />

但是在 android 5-7 上出现了这个错误。我无法打开任何网址。谷歌,例如

Encountered an error loading page, Object {
  "canGoBack": false,
  "canGoForward": false,
  "code": -1,
  "description": "net::ERR_CACHE_MISS",
  "loading": false,
  "target": 679,
  "title": "",
  "url": "https://google.com/",
}
at node_modules/react-native-webview/lib/WebView.android.js:167:12 in _this.onLoadingError
at [native code]:null in callFunctionReturnFlushedQueue

标签: javascriptreactjsreact-nativeexporeact-native-webview

解决方案


推荐阅读