React Native Expo Android WebView

问题描述 投票:0回答:1

我正在使用Expo开发一个React Native应用。尝试使用“ react-native-webview”加载WebView。

这是WebView元素:

<WebView style={styles.container}
            source={{ uri: "https://www.google.com/" }}
            ref={ref => (this.webview = ref)}
            cacheEnabled={false}    
/>

我正在设备上运行该应用程序,在iOS上运行良好,但是在Android上,该应用无法加载网站,并且出现错误。

Encountered an error loading page, Object {
  "canGoBack": false,
  "canGoForward": false,
  "code": -1,
  "description": "net::ERR_CACHE_MISS",
  "loading": false,
  "target": 25,
  "title": "",
  "url": "https://www.google.com/",
}

博览会版本-3.19.2

Android版本-5.0

找不到有效的解决方案,有人知道缺少什么吗?

android react-native webview android-webview expo
1个回答
0
投票

这是Android问题,目前已在androidx.appcompat:appcompat:1.2.0中解决,您可以使用1.1.0。

您需要升级博览会版本。它可能会解决您的问题

© www.soinside.com 2019 - 2024. All rights reserved.