gpt4 book ai didi

ios - react 原生/iOS SDK。 iOS SDK 更新到 14.5 后调用 'RCTBridgeModuleNameForClass' 没有匹配函数

转载 作者:行者123 更新时间:2023-12-03 15:45:20 25 4
gpt4 key购买 nike

我已将 iOS SDK 平台更新到版本 14.5 . Xcode 版本现在是 12.5 .更新后,我无法在我的设备上启动该应用程序。并且编译器会抛出一个错误:

No matching function for call to 'RCTBridgeModuleNameForClass'


我尝试重新安装 pod,但没有帮助。如何解决?谢谢
enter image description here

最佳答案

将此代码放在 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com