ios - iOS 上的 react-native-share 无法读取未定义的属性“FACEBOOK”
问题描述
当我开始使用时,我在 iOS 模拟器中收到此错误react-native-share
cannot read property 'FACEBOOK' of undefined
RNShare
index.js:208:36
...
跑后
npm install
我跑cd ios/ && pod install
这是package.json
一部分
"dependencies": {
"@react-native-community/datetimepicker": "2.2.2",
"jetifier": "^1.6.5",
"react": "16.12.0",
"react-native": "0.61.5",
"react-native-base64": "0.0.2",
"react-native-device-info": "3.1.4",
"react-native-gesture-handler": "1.4.1",
"react-native-modal-datetime-picker": "8.5.1",
"react-native-screens": "^2.7.0",
"react-native-share": "^3.3.0",
"react-native-vector-icons": "6.6.0",
这是 Podfile 的一部分
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'mobile' do
...
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
...
pod 'RNShare', :path => '../node_modules/react-native-share'
解决方案
由于您使用的是 RN 版本,因此0.61
您不必手动添加RNShare
podfile。
pod 'RNShare', :path => '../node_modules/react-native-share'
从 pod 文件中删除- 删除
pods
ios文件夹中的文件夹和podlock文件 pod install
再次运行
https://github.com/react-native-community/react-native-share#automatic-way
推荐阅读
- html - 离子,HTML 数组
- terraform - 如果 Terraform 的条件
- domain-driven-design - DDD + CQRS + ES:实体或 dto 可以成为命令的一部分吗?
- javascript - 将事件侦听器添加到表格单元格内的类
- javascript - 如何防止我的表单的只读字段数据?
- python - 我正在使用 PIL 将大型 HDF 文件传输到 tiff 堆栈,但遇到代码问题
- java - 如何在firebase数据库中获取嵌套键
- swift - Swift中引用类型变量的困惑
- python - 拆分多列
- c# - 如果我在那里复制项目,如何分配可以在任何计算机上工作的数据源?