react-native - 异常 '-[__NSCFString containsObject:]: unrecognized selector sent to instance 0x60000140a440' 在目标上调用 canOpenURL 时被抛出
问题描述
异常 '-[__NSCFString containsObject:]: unrecognized selector sent to instance 0x60000140a440' was throwed while calling canOpenURL on target LinkingManager with params ("about:srcdoc", 41622, 41623
我在我的 React-Native 应用程序中尝试使用 WebView 时遇到了这个问题。我只在 iOS 中看到这个错误,android 运行良好。这是我的 WebView 代码。
返回 (
<View style={{ flex: 1, }}>
<SafeAreaView style={{ flex: 1, }}>
{renderHeader()}
<WebView
source={{uri: 'https://medmate.com.au/frequently-asked-questions/'}}
renderLoading={() => (
<ActivityIndicator
color={colors.BUTTON_BG}
size='large'
style={{position: 'absolute',
width: '100%',
height: '100%',
backgroundColor: 'white',
alignSelf: 'center',
justifyContent: 'center',
top: 0,
left: 0,
right: 0,
bottom: 0,
zIndex: 10,
elevation: 1000,}}
/>
)}
/>
这是模拟器错误。
https://i.stack.imgur.com/ObQRO.png
这是我的 package.json 文件:
1.https://i.stack.imgur.com/e9ftl.jpg 2.https: //i.stack.imgur.com/nbnOf.jpg
解决方案
检查 originWhitelist 并添加 *.
originWhitelist={['*']}
推荐阅读
- python - Python XML eBay API 调用
- javascript - 在输入表中添加或删除行
- google-cloud-firestore - 如何使用内部集合 Firestore 执行添加集合
- java - 使用 Java LinkedList 中的方法查找百分比
- javascript - JavaScript replaceAll 使用变量而不是字符串进行不区分大小写的搜索
- jquery - ProcessMaker 如何通过 Javascript 使用 API 更新用户
- php - 在 elliptic-php 上验证签名失败,错误是“无法初始化”
- in-app-purchase - 我取消订阅后HMS IAP没有续费事件
- python - 即使 pycharm 没有发现错误,urllib.request 脚本也会出错
- r - kableExtra column_spec 错误 - 可能是 dplyr 总结