skip to Main Content

I have upgraded mac to macOS Ventura V13

XCode Version 14.0.1

Until today everything worked perfectly on my mac for React Native, it had been days since I started anything new

Today I wanted to start a new project and I got some errors.

It’s been several days looking for a solution to this problem and of course I’m not giving up, but I think trying things randomly will only mess up my configuration a lot more

Can you help me with this ?

Would it be wise to remove all my React Native Development setup and environment and start over?

I have started like this:

npx react-native init MyProject

I EDIT THE QUESTION AFTER MAKING CHANGES

I have updated my version of ruby following the steps of user @Janaka-Steph, and the project builds perfectly, but when I run the app in terminal with nxp react-native run-ios , it doesn’t compile and I keep getting the following errors:

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

I don’t add all the console output because it’s a lot and always repeated, but this is also shown in the console errors at the end:

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.

I have tried to run the application in XCode, but I also get errors:

**'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')***

And of course the following:

Typedef redefinition with different types (‘uint8_t’ (aka ‘unsigned char’) vs ‘enum clockid_t’)

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

  • 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

Run script build phase ‘Bundle React Native code and images’ will be
run during every build because it does not specify any outputs. To
address this warning, either add output dependencies to the script
phase, or configure it to run in every build by unchecking "Based on
dependency analysis" in the script phase.

When I try to run the project for Android ( npx react-native run-android), it doesn’t work either, I get a lot of errors, but when I run the project in Android Studio, everything works

I must say that I have put into practice some of the solutions proposed in questions similar to mine, but I can’t find a solution.

I’ve googled, Forums, Stack for solutions and found stuff, made changes to my React Native install, install Node again, Brew again, made a lot of changes and now nothing works.

2

Answers


  1. Did you upgrade your ruby ? it clearly states that your ruby version is wrong

    error Your Ruby version is 2.6.10, but your Gemfile specified 2.7.5
    

    I guess the Bundler is not installed when you initialized the project.

    PS: This can be due to an update in any of the packages including RN in your new project

    Login or Signup to reply.
  2. I faced the same issue after upgrading to macOS Ventura 13 on M1. It seems that the upgrade broke my Ruby environment. So I had to recreate it. Maybe all those steps are not necessary but I give you what worked for me.

    Make sure you remove cocoapods

    sudo gem uninstall cocoapods
    gem uninstall cocoapods
    brew uninstall cocoapods
    // should return no path
    which pod
    

    Now the only thing that worked for me is to install cocoapods with brew

    brew install cocoapods
    

    I use rvm to manage Ruby versions.

    Nuke everything

    rvm implode
    

    Reinstall ruby

    rvm get stable
    rvm use "ruby-2.7.5"
    

    Make sure you have cocoapods in your gemfile

    gem "cocoapods", "1.11.3"
    

    Reinstall pods

    cd ios
    pod cache clean --all 
    pod deintegrate 
    pod setup --verbose
    bundle install 
    bundle exec pod install
    cd ..
    

    You should then be able to run npx react-native run-ios

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search