reactjs - 在 React-RCTWebSocket.modulemap 中重新定义模块“React”
问题描述
再会,
我们刚刚react-native
从升级0.59.10
到0.60.0
。主要是我们一直在遵循这些指南:
https://react-native-community.github.io/upgrade-helper/?from=0.59.10&to=0.60.0
https://mattoakes.net/react-native-upgrade-guides/upgrade-to-react-native-0.60
对于 Android,升级过程非常简单。但是我的团队在做 iOS 端时遇到了很多困难。
在遵循这些指南并解决了一些问题之后,我们面临着一个我们找不到任何信息的问题......我们已经在这里停留了一段时间。
所以,问题是:当我们构建项目时,出现下一个错误。
在阅读了一些类似的主题后,社区的其他人建议我们可能会在 XCode 项目的目标中Build Settings
添加相同的包两次。Build Phases
但我找不到任何一个:/
我怀疑错误来自我们的Podfile
,但对我来说看起来不错:
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
use_modular_headers!
def pods()
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec', :modular_headers => false
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec', :modular_headers => false
end
target 'OneSignalNotificationServiceExtension' do
# Pods for OneSignalNotificationServiceExtension
use_native_modules!
end
target 'XXX' do
# Pods for xxx
pods()
target 'XXXTests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'No'
end
end
end
end
就是这样,有人可以帮助我们吗?
如果您希望我附上任何内容以获取有关错误的更多信息,请随时询问。
欢迎所有建议:)
解决方案
我的 pod 中的一个包也有同样的问题,需要我使用该use_modular_headers!
设置。
这似乎会导致反应模块中的冲突,因为它的定义反应两次。对我来说,解决方法是:modular_headers => false
在 podfile 中的每个反应包之后添加。这是我的反应版本 0.60.6 的 podfile 作为示例。
target ‘app’ do
use_modular_headers!
# Pods for RNDiffapp
pod ‘React’, :path => ‘../node_modules/react-native/’
pod ‘React-Core’, :path => ‘../node_modules/react-native/React’
pod ‘React-DevSupport’, :path => ‘../node_modules/react-native/React’, :modular_headers => false
pod ‘React-RCTActionSheet’, :path => ‘../node_modules/react-native/Libraries/ActionSheetIOS’, :modular_headers => false
pod ‘React-RCTAnimation’, :path => ‘../node_modules/react-native/Libraries/NativeAnimation’, :modular_headers => false
pod ‘React-RCTBlob’, :path => ‘../node_modules/react-native/Libraries/Blob’, :modular_headers => false
pod ‘React-RCTImage’, :path => ‘../node_modules/react-native/Libraries/Image’, :modular_headers => false
pod ‘React-RCTLinking’, :path => ‘../node_modules/react-native/Libraries/LinkingIOS’, :modular_headers => false
pod ‘React-RCTNetwork’, :path => ‘../node_modules/react-native/Libraries/Network’, :modular_headers => false
pod ‘React-RCTSettings’, :path => ‘../node_modules/react-native/Libraries/Settings’, :modular_headers => false
pod ‘React-RCTText’, :path => ‘../node_modules/react-native/Libraries/Text’, :modular_headers => false
pod ‘React-RCTVibration’, :path => ‘../node_modules/react-native/Libraries/Vibration’, :modular_headers => false
pod ‘React-RCTWebSocket’, :path => ‘../node_modules/react-native/Libraries/WebSocket’, :modular_headers => false
pod ‘React-cxxreact’, :path => ‘../node_modules/react-native/ReactCommon/cxxreact’, :modular_headers => false
pod ‘React-jsi’, :path => ‘../node_modules/react-native/ReactCommon/jsi’, :modular_headers => false
pod ‘React-jsiexecutor’, :path => ‘../node_modules/react-native/ReactCommon/jsiexecutor’, :modular_headers => false
pod ‘React-jsinspector’, :path => ‘../node_modules/react-native/ReactCommon/jsinspector’, :modular_headers => false
pod ‘yoga’, :path => ‘../node_modules/react-native/ReactCommon/yoga’, :modular_headers => false
pod ‘DoubleConversion’, :podspec => ‘../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec’, :modular_headers => false
pod ‘glog’, :podspec => ‘../node_modules/react-native/third-party-podspecs/glog.podspec’, :modular_headers => false
pod ‘Folly’, :podspec => ‘../node_modules/react-native/third-party-podspecs/Folly.podspec’, :modular_headers => false
我省略了 React 和 React-Core,因为这些是首先被重新定义的模块。
推荐阅读
- javascript - 修改箭头函数javascript
- python - django项目中excel模板文件放在哪里
- python - 在 groupby 之后为类别添加一列
- javascript - 当我在表单中输入输入时,React 组件不必要地重新渲染
- c++ - 如何在不同类的私有成员中声明指向类对象数组的指针?
- c# - C# Casting T where T: struct 到一个没有装箱的接口
- python - 通过关系获取模型的_meta
- c# - 如果在 XAML 中使用选项卡按钮,第一个 TextBox 不显示光标并且无法键入任何内容
- sql - 浮点数据类型中的 Oracle SQL 插入 -ve Infinity
- python - IntegrityError NOT NULL 约束失败:-在验证表单中缺少用户 ID(另一个模型的外键)