question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Weird build failure on Xcode after updating to RN 0.66.1

See original GitHub issue

Description

After updating RN from 0.65.1 to 0.66.1, my iOS builds were failing with the following errors.

Screenshot 2021-10-18 at 17 15 49

I thought one of the libraries I’m using is not compatible with the new version, so I’ve started a new project from the typescript template and added them one by one. I turned out that that every time I add a new library with a native change, I get this error message and the only way to bypass it is by cleaning the project and restarting it with the following commands.

rm -rf node_modules ios/build ios/Pods ios/Podfile.lock && yarn cache clean yarn && cd ios && pod install && cd ../ yarn start --reset-cache

React Native version:

System:
    OS: macOS 11.6
    CPU: (8) arm64 Apple M1
    Memory: 353.69 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.9.1 - /opt/homebrew/bin/node
    Yarn: 1.22.11 - /opt/homebrew/bin/yarn
    npm: 7.21.1 - /opt/homebrew/bin/npm
    Watchman: 2021.09.13.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0
    Android SDK:
      API Levels: 29, 30, 31
      Build Tools: 29.0.2, 30.0.2, 31.0.0
      System Images: android-31 | ARM 64 v8a, android-31 | Google APIs ARM 64 v8a, android-31 | Google Play ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 13.0/13A233 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.66.1 => 0.66.1 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

  1. Init a new project (I tested only on Typescript)
  2. Install dependencies, build from Xcode
  3. Install a library any native change so that you can pod install after too (I guarantee it works with the following: react-native-svg + react-native-svg-transformer, react-native-reanimated, react-native-device-info, react-native-dotenv, react-native-file-logger, react-native-safe-area-context)
  4. Restart metro and rebuild from Xcode

Expected Results

App should build successfully as it normally does.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:20
  • Comments:36 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
Deepackscommented, Oct 28, 2021

@J6ey @askndaer1 Hello, i want to share this even though i am in total disbelief that i could get it working because of this.

I had to make sure to place the project (so when i type npx react-native init AppName) in a folder route that must not include any spaces.

This will cause errors ~ cd Desktop/this\ wont\ work && npx react-native init AppName This will work flawlessly ~ cd Desktop/this-will/ && npx react-native init AppName

Some info about my config:

  • I have installed pod (v 1.11.2) through sudo gem install cocoapods and i also had to install ffi, with the same command, since it is recommended for mac M1 users.
  • Latest node version, through homebrew brew install node
  • Xcode 13.1

Please let me know if your issues can be solved by checking this painfully simple thing.

7reactions
J6eycommented, Oct 28, 2021

@Deepacks I had the same issue on “react-native”: “0.66.1” Changing back to “react-native”: “0.65.1” in the package.json, then npm install, pod update, pod install fixed it for me!

Also be sure to comment out __apply_Xcode_12_5_M1_post_install_workaround(installer)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build failure on Xcode 12.3,12.5 post updating react native ...
Getting build failure while trying to compile my project post upgrading my react-native version to 0.66.0. My Podfile require_relative '.
Read more >
Build Failed — but no reason! | Apple Developer Forums
Hi, I'm experiencing weird Xcode behavior. I'm getting "build failed" after some alterations to the code, but Xcode will NOT give me the...
Read more >
cocoapods could not find compatible versions for pod "rct-folly"
You are seeing this error because either: - Versions in the Podfile.lock cached by EAS do not match required values in Podspecs of...
Read more >
Cannot build iOS App on Xcode after upgrade to RN 0.66 and ...
[Solved]-Cannot build iOS App on Xcode after upgrade to RN 0.66 and Xcode 13 'gtest/gtest.h' file not found-React Native.
Read more >
Build failing on Xcode 13.2 : r/reactnative - Reddit
It seems to be a flipper related problem, but can't be 100% sure since I don't have much info about your project.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found