没有名为“cancelButtonTintColor”的成员在“JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions”中

发布于 2025-01-09 13:05:55 字数 1118 浏览 3 评论 0原文

描述

如何修复此错误。我已经使用最新版本创建了简单的项目,当尝试通过 Xcode 构建项目时,它会生成错误吗?

版本

0.67.3

输出npxreact-native信息

OS: macOS 11.5.2
CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
Memory: 83.30 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.18.2 - /usr/local/opt/node@14/bin/node
Yarn: 1.22.15 - /usr/local/bin/yarn
npm: 6.14.15 - /usr/local/opt/node@14/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7583922
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
Languages:
Java: 15.0.2 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.3 => 0.67.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

重现步骤

请使用命令 init 新的 React Native 项目,并在 pod install 后尝试在 xcode 中构建项目

Description

How to fix this error. I have created simple project with latest version and when try to build the project via Xcode it generate error?

Version

0.67.3

Output ofnpxreact-native info

OS: macOS 11.5.2
CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
Memory: 83.30 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.18.2 - /usr/local/opt/node@14/bin/node
Yarn: 1.22.15 - /usr/local/bin/yarn
npm: 6.14.15 - /usr/local/opt/node@14/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7583922
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
Languages:
Java: 15.0.2 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.3 => 0.67.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

Please init new react native project with command and try to build the project in the xcode after pod install

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

走野 2025-01-16 13:05:55

每次 pod-install => 之后干净构建 XCode >产品>清理构建文件夹(command + shift + k)=>重建,那工作。
问题在于 rn > 0.67.0,pod-cache 指向旧文件。
https://github.com/facebook/react-native/commit/01856633a1d42ed3b26e7cc93a007d7948e1f76e

after each time pod-install => clean build XCode > Product > Clean Build Folder(command + shift + k) => rebuild, that work.
The problem is with rn > 0.67.0, pod-cache pointing to the old file.
https://github.com/facebook/react-native/commit/01856633a1d42ed3b26e7cc93a007d7948e1f76e

携君以终年 2025-01-16 13:05:55

您可以将其创建到库源中,也可以避免它并使用其上方相同的 UIColor 选项。

我删除了:
([RCTConvert UIColor:options.cancelButtonTintColor() ? @( options.cancelButtonTintColor()) : nil];* )
并将其替换为:
( *[RCTConvert UIColor:options.tintColor() ? @(options.tintColor()) : nil]; )

我的行现在看起来像:

UIColor *cancelButtonTintColor =
[RCTConvert UIColor:options.tintColor() ? @(*options.tintColor()) : nil];

这不是更好的方法,但你可以做到与此同时,这是固定的。

You could create that into the library source or you could avoid it and use the same UIColor option just above it.

I removed:
( [RCTConvert UIColor:options.cancelButtonTintColor() ? @( options.cancelButtonTintColor()) : nil];* )
and replace it with:
( *[RCTConvert UIColor:options.tintColor() ? @(options.tintColor()) : nil]; )

my line now looks like:

UIColor *cancelButtonTintColor =
[RCTConvert UIColor:options.tintColor() ? @(*options.tintColor()) : nil];

it is not the better way, but you can do it in the meanwhile this is fixed.

对岸观火 2025-01-16 13:05:55

pod 安装后清理构建文件夹对我有用,

在顶部导航栏中单击 Production --->清理构建文件夹

clean build folder after pod install worked for me

in top navigation bar click on Production ---> Clean Build Folder

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文