在重建React Native项目时,IOS的构建失败

3xiyfsfu  于 2023-04-07  发布在  React
关注(0)|答案(2)|浏览(158)

我正在用Xcode 13/cocoapods 1.15逐个通过yarn add模块重建我的React Native 0.67.4项目。在添加了几个模块之后,使用IOS 15模拟器运行pod installnpx react-native run-ins进行测试。在添加了几个模块并成功添加pod install后,出现以下错误。我感觉该错误与pod相关,但不知道如何修复。这里是错误

/Users/macair/Documents/code/js/xyz_app6/node_modules/react-native/React/CoreModules/RCTActionSheetManager.mm:98:35: error: no member named 'cancelButtonTintColor' in 'JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions'
      [RCTConvert UIColor:options.cancelButtonTintColor() ? @(*options.cancelButtonTintColor()) : nil];
                          ~~~~~~~ ^
/Users/macair/Documents/code/js/xyz_app6/node_modules/react-native/React/CoreModules/RCTActionSheetManager.mm:98:72: error: no member named 'cancelButtonTintColor' in 'JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions'
      [RCTConvert UIColor:options.cancelButtonTintColor() ? @(*options.cancelButtonTintColor()) : nil];
                                                               ~~~~~~~ ^
2 errors generated.

......

** BUILD FAILED **

The following build commands failed:
    CompileC /Users/macair/Library/Developer/Xcode/DerivedData/xyz_app6-drkombcrczieyyfirepznaljzqwr/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-CoreModules.build/Objects-normal/x86_64/RCTActionSheetManager.o /Users/macair/Documents/code/js/xyz_app6/node_modules/react-native/React/CoreModules/RCTActionSheetManager.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-CoreModules' from project 'Pods')
(1 failure)
bhmjp9jg

bhmjp9jg1#

执行以下步骤:
1.删除node_modules文件夹

  1. npm installyarn install
    1.删除pods文件夹和Podfile.lock文件
  2. cd ios && pod install
    1.运行项目npx react-native run-ios
    希望能成功!
jfewjypa

jfewjypa2#

我试过清理所有东西,但对我不起作用。最后,这个问题与React-Codegen pod的iOS部署目标有关。将其更改为我项目的最低iOS版本对我有效。请参阅此评论;https://github.com/facebook/react-native/issues/34126#issuecomment-1492157907

相关问题