gpt4 book ai didi

react-native - 当 `ios` 时,React native 构建在 `react-native run-ios` 上失败

转载 作者:行者123 更新时间:2023-12-05 07:04:28 24 4
gpt4 key购买 nike

当我试图在 ios 模拟器上运行应用程序时,我得到了这个。谁能指导我这个问题的原因/解决方案。

以下构建命令失败:

CompileC /Users/xxx/Library/Developer/Xcode/DerivedData/eattog-dfbqbeyhmbgzhfcodvhlcaqjxepf/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/ReactCommon.build/Objects-normal/x86_64/RCTTurboModuleManager.o/Users/xxx/Documents/React-Native-Projects/eattog/node_modules/react-native/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler

谢谢

最佳答案

只需在 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

关于react-native - 当 `ios` 时,React native 构建在 `react-native run-ios` 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62920980/

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