作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已将 iOS SDK 平台更新到版本 14.5 . Xcode 版本现在是 12.5 .更新后,我无法在我的设备上启动该应用程序。并且编译器会抛出一个错误:
No matching function for call to 'RCTBridgeModuleNameForClass'
最佳答案
将此代码放在 ios/Podfile 的底部
post_install do |installer|
## Fix for XCode 12.5
find_and_replace("../node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm",
"_initializeModules:(NSArray<id<RCTBridgeModule>> *)modules", "_initializeModules:(NSArray<Class> *)modules")
find_and_replace("../node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm",
"RCTBridgeModuleNameForClass(module))", "RCTBridgeModuleNameForClass(Class(module)))")
end
def find_and_replace(dir, findstr, replacestr)
Dir[dir].each do |name|
text = File.read(name)
replace = text.gsub(findstr,replacestr)
if text != replace
puts "Fix: " + name
File.open(name, "w") { |file| file.puts replace }
STDOUT.flush
end
end
Dir[dir + '*/'].each(&method(:find_and_replace))
end
保存它,做一个
pod install
在终端上并尝试再次运行/构建您的项目!
关于ios - react 原生/iOS SDK。 iOS SDK 更新到 14.5 后调用 'RCTBridgeModuleNameForClass' 没有匹配函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67287092/
我已将 iOS SDK 平台更新到版本 14.5 . Xcode 版本现在是 12.5 .更新后,我无法在我的设备上启动该应用程序。并且编译器会抛出一个错误: No matching function
我是一名优秀的程序员,十分优秀!