13 javascript webview reactjs react-native expo
我正在使用 react native(expo) 并尝试使用 web view package 我在控制台中收到此警告,但在移动屏幕上没有看到任何内容。
"sdkVersion": "36.0.0",
“博览会”:“~36.0.0”,
"react-native": " https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz ",
"react-native-webview": "^8.0.2",
错误:
加载页面时遇到错误,Object { "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 在控制台中。警告 - node_modules\expo\build\environment\muteWarnings.fx.js:18:23 in warn * http://192.168.1.100:19001/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&minify=false&hot=false: 209150:21在 onLoadingError - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:307:15 invokeGuardedCallbackImpl - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:531:36 invokeGuardedCallbackImpl中- node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:555:30 invokeGuardedCallbackAndCatchFirstError
- node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:722:42 in executeDispatch http ://192.168.1.100:19001/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&minify=false&hot=false:209150:21在 onLoadingError - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:307:15 invokeGuardedCallbackImpl - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:531:36 invokeGuardedCallbackImpl中- node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:555:30 invokeGuardedCallbackAndCatchFirstError - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:722:42 in node_modules \react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:744:20 在 executeDispatchesInOrder - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:907:29 in executeDispatchesAndRelease - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:889:12 in forEachAccumulated - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js1:932: runEventsInBatch - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:1096:19 in runExtractedPluginEventsInBatch - node_modules\react-native\Libraries\Renderer\implementations\ReactNative$Renderer-dev.js:2796 argument_0 - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:18791:14 in batchedUpdates$1 - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:2709:30 in batchedUpdates - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:2794:17 in batchedUpdates$argument_0 - node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:281 26 in receiveEvent - node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:436:47 in __callFunction - node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:111:26 in __guard$argument_0 - node_modules\react native\Libraries\BatchedBridge\MessageQueue.js:384:10 in __guard - node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:110:17 in __guard$argument_0 * [native code]:null in callFunctionReturnFlushedQueue26 in receiveEvent - node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:436:47 in __callFunction - node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:111:26 in __guard$argument_0 - node_modules\react native\Libraries\BatchedBridge\MessageQueue.js:384:10 in __guard - node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:110:17 in __guard$argument_0 * [native code]:null in callFunctionReturnFlushedQueue26 in receiveEvent - node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:436:47 in __callFunction - node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:111:26 in __guard$argument_0 - node_modules\react native\Libraries\BatchedBridge\MessageQueue.js:384:10 in __guard - node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:110:17 in __guard$argument_0 * [native code]:null in callFunctionReturnFlushedQueuecallFunctionReturnFlushedQueue 中的 nullcallFunctionReturnFlushedQueue 中的 null
我假设您在旧版 Android 设备上也遇到过这种情况?较新的 Android 设备不应该出现此问题,Expo 正在修复此问题,但目前还没有明确的时间表。最好的建议是在 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 已经发布,但 Expo 尚未透露何时推出。https://github.com/expo/expo/issues/6665#issuecomment-614451492
注意:我在运行 Android 5.1.1 Lollipop 的 Samsung Galaxy Tab 4 上遇到了同样的问题。这是使用隧道、LAN 或本地连接模式发生的。
一位用户确认“WebView Android 版本 5.0 不起作用(Android 版本 8-10 没有任何问题)” https://forums.expo.io/t/webview-unable-to-load-url-got-错误-错误-缓存-未命中/40011/3
如果这些存储库中的任何一个能够解决该问题,我将更新此答案。
正如您在此演示中所看到的,它确实可以在 Android 模拟器上运行: https: //snack.expo.io/@wodin/webview-example
| 归档时间: |
|
| 查看次数: |
985 次 |
| 最近记录: |