我正在用Xcode 13/cocoapods 1.15逐个通过yarn add
模块重建我的React Native 0.67.4项目。在添加了几个模块之后,使用IOS 15模拟器运行pod install
和npx 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)
2条答案
按热度按时间bhmjp9jg1#
执行以下步骤:
1.删除
node_modules
文件夹npm install
或yarn install
1.删除
pods
文件夹和Podfile.lock
文件cd ios && pod install
1.运行项目
npx react-native run-ios
希望能成功!
jfewjypa2#
我试过清理所有东西,但对我不起作用。最后,这个问题与React-Codegen pod的iOS部署目标有关。将其更改为我项目的最低iOS版本对我有效。请参阅此评论;https://github.com/facebook/react-native/issues/34126#issuecomment-1492157907