我正在使用react本机(Expo)并尝试使用web视图套餐,并且我在控制台中得到了这个警告,并且没有在移动屏幕上看到任何东西。
"sdkVersion":"36.0.0“ “博览会”:"~36.0.0", “反应-原生”:"https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz", “react原生-webview”:"^8.0.2“
错误:
加载页面时遇到错误,对象{ "canGoBack":false,"canGoForward":false,"code":-1,"description":"net::ERR_CACHE_MISS"," loading ":false,"target":2665,"title":"","url":"https://facebook.github.io/react-native/",}- node_modules\react-native\Libraries\YellowBox\YellowBox.js:71:8 in console.warn - node_modules\expo\build\environment\muteWarnings.fx.js:18:23 in console.warn* modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&minify=false&hot=false:209150:21 in onLoadingError - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:307:15 in invokeGuardedCallbackImpl - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:531:36 in invokeGuardedCallback - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:555:30 in invokeGuardedCallbackAndCatchFirstError
发布于 2020-08-28 04:15:15
我想这是发生在你的老Android设备上吗?较新的Android设备不应该有这个问题,世博的工作中有一个修正,但目前还没有确定的时间表。最好的建议是在iOS设备、仿真器或构建APK上进行开发,并且您应该能够将它加载到您的旧设备上,而不存在任何问题。
“看起来这是一个上游的Android问题,在androidx.appcompat:appcompat:1.2.0中得到了解决,目前我们仍然使用1.1.0
因为1.2.0仍然在alpha中,所以等待它成为一个稳定的版本“https://github.com/expo/expo/issues/6665#issuecomment-571623759”可能是个好主意
看上去,截至4月16日,1.2.0已经发布,但世博会还没有发布任何消息。https://github.com/expo/expo/issues/6665#issuecomment-614451492
注意:我在运行Android5.1.1Lolliop的三星Galaxy 4上也遇到了同样的问题。这种情况发生在隧道、局域网或本地连接模式下。
一位用户确认"WebView安卓版本5.0不起作用(AndroidVersion8-10没有任何问题)“https://forums.expo.io/t/webview-unable-to-load-url-got-error-err-cache-miss/40011/3
我将更新这个答案,如果任何一个这些回购提出了一个解决方案的问题。
正如您在本演示中所看到的,它确实可以在Android模拟器:https://snack.expo.io/@wodin/webview-example上工作。
https://stackoverflow.com/questions/59692110
复制相似问题