Mig*_*eso 7 javascript xcode ios reactjs react-native
我已将 Mac 升级到 macOS Ventura V13
XCode 版本 14.0.1
直到今天,我的 Mac 上的 React Native 一切都运行得很好,距离我开始新的东西已经好几天了
今天我想开始一个新项目,但遇到了一些错误。
我已经花了几天时间寻找这个问题的解决方案,当然我不会放弃,但我认为随机尝试只会让我的配置更加混乱
你能帮我吗?
删除我所有的 React Native 开发设置和环境并重新开始是否明智?
我是这样开始的:
npx react-native init MyProject
Run Code Online (Sandbox Code Playgroud)
我在更改后编辑问题
我已经按照用户 @Janaka-Steph 的步骤更新了我的 ruby 版本,并且该项目构建完美,但是当我使用 nxp react-native run-ios 在终端中运行该应用程序时,它无法编译,并且我不断收到以下错误:
warn Multiple Podfiles were found: ios/Podfile,vendor/bundle/ruby/2.7.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
info Found Xcode workspace "myProject.xcworkspace"
info Building (using "xcodebuild -workspace myProject.xcworkspace -configuration Debug -scheme myProject -destination id=")
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening myProject.xcworkspace.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace myProject.xcworkspace -configuration Debug -scheme myProject -destination id=
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
Prepare packages
Computing target dependency graph and provisioning inputs
Create build description
Build description signature:
Build description path: /Users/miguelito/Library/Developer/Xcode/DerivedData/myProject-cgujjydukqoyfycbyxyuqiquehll/Build/Intermediates.noindex/XCBuildData/fb-desc.xcbuild
note: Building targets in dependency order
CreateBuildDirectory /Users/miguelito/Library/Developer/Xcode/DerivedData/myProject-cgujjydukqoyfycbyxyuqiquehll/Build/Intermediates.noindex
cd /Volumes/DeTodo/REACT\ NATIVE/myProject/ios
builtin-create-build-directory /Users/miguelito/Library/Developer/Xcode/DerivedData/myProject-cgujjydukqoyfycbyxyuqiquehll/Build/Intermediates.noindex
Run Code Online (Sandbox Code Playgroud)
我没有添加所有控制台输出,因为它很多并且总是重复,但这也显示在最后的控制台错误中:
In file included from /Volumes/DeTodo/REACT NATIVE/myProject/ios/Pods/libevent/event-internal.h:43:
/Volumes/DeTodo/REACT NATIVE/myProject/ios/Pods/libevent/defer-internal.h:44:11: warning: parameter 'deferred' not found in the function declaration [-Wdocumentation]
@param deferred The struct event_callback structure to initialize.
^~~~~~~~
/Volumes/DeTodo/REACT NATIVE/myProject/ios/Pods/libevent/defer-internal.h:45:11: warning: parameter 'priority' not found in the function declaration [-Wdocumentation]
@param priority The priority that the callback should run at.
^~~~~~~~
/Volumes/DeTodo/REACT NATIVE/myProject/ios/Pods/libevent/defer-internal.h:46:11: warning: parameter 'cb' not found in the function declaration [-Wdocumentation]
@param cb The function to run when the struct event_callback executes.
^~
/Volumes/DeTodo/REACT NATIVE/myProject/ios/Pods/libevent/defer-internal.h:47:11: warning: parameter 'arg' not found in the function declaration [-Wdocumentation]
@param arg The function's second argument.
^~~
In file included from /Volumes/DeTodo/REACT NATIVE/myProject/ios/Pods/libevent/select.c:57:
/Volumes/DeTodo/REACT NATIVE/myProject/ios/Pods/libevent/include/event2/thread.h:187:11: warning: parameter 'base' not found in the function declaration [-Wdocumentation]
@param base the event base for which to set the id function
^~~~
52 warnings generated.
Run Code Online (Sandbox Code Playgroud)
我尝试在 XCode 中运行该应用程序,但也收到错误:
**'CLOCK_REALTIME' macro redefined**
in file included from /myProject/ios/Pods/RCT-Folly/folly/io/async/TimeoutManager.cpp:22:
previous definition is here
**'CLOCK_MONOTONIC' macro redefined**
in file included from /myProject/ios/Pods/RCT-Folly/folly/io/async/TimeoutManager.cpp:22:
in file included from /myProject/ios/Pods/Headers/Private/RCT-Folly/folly/Chrono.h:26:
previous definition is here
**'CLOCK_PROCESS_CPUTIME_ID' macro redefined**
in file included from /myProject/ios/Pods/RCT-Folly/folly/io/async/TimeoutManager.cpp:22:
in file included from /myProject/ios/Pods/Headers/Private/RCT-Folly/folly/Chrono.h:26:
previous definition is here
**'CLOCK_THREAD_CPUTIME_ID' macro redefined**
in file included from /myProject/ios/Pods/RCT-Folly/folly/io/async/TimeoutManager.cpp:22:
in file included from /myProject/ios/Pods/Headers/Private/RCT-Folly/folly/Chrono.h:26:
previous definition is here
.../ios/Pods/Headers/Private/RCT-Folly/folly/portability/Time.h:52:17: ***Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t')***
Run Code Online (Sandbox Code Playgroud)
当然还有以下内容:
使用不同类型的 Typedef 重新定义('uint8_t'(又名'unsigned char')与'enum Clockid_t')
在 /myProject/ios/Pods/RCT-Folly/folly/io/async/TimeoutManager.cpp:22 包含的文件中:在 /myProject/ios/Pods/Headers/Private/RCT-Folly/folly/Chrono 包含的文件中。 h:26:之前的定义在这里
- 在 /myProject/ios/Pods/RCT-Folly/folly/io/async/TimeoutManager.cpp:22 包含的文件中:
- 在 /myProject/ios/Pods/Headers/Private/RCT-Folly/folly/Chrono.h:26 包含的文件中:以前的定义在这里
运行脚本构建阶段“捆绑 React Native 代码和图像”将在每次构建期间运行,因为它没有指定任何输出。要解决此警告,请将输出依赖项添加到脚本阶段,或者通过取消选中脚本阶段中的“基于依赖项分析”将其配置为在每个构建中运行。
当我尝试运行 Android ( ) 项目时npx react-native run-android
,它也不起作用,出现很多错误,但是当我在 Android Studio 中运行该项目时,一切正常
我必须说,我已经将与我类似的问题中提出的一些解决方案付诸实践,但我找不到解决方案。
我用谷歌搜索、论坛、堆栈寻找解决方案并找到了一些东西,对我的 React Native 安装进行了更改,再次安装 Node,再次 Brew,做了很多更改,但现在没有任何效果。
你的红宝石升级了吗?它清楚地表明你的 ruby 版本是错误的
error Your Ruby version is 2.6.10, but your Gemfile specified 2.7.5
Run Code Online (Sandbox Code Playgroud)
我猜你初始化项目时没有安装 Bundler。
PS:这可能是由于新项目中的任何软件包(包括 RN)的更新所致
归档时间: |
|
查看次数: |
4234 次 |
最近记录: |