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.

Builds failing on 2021 Apple MacBook Pro with Apple Silicon M1 Pro - ReactNative 0.62.2 & XCode 13.1

See original GitHub issue

Description

Hi Team,

Tried various options to get the project running, but all builds are failing. Tried installing pods with arch -x86_64 pod install --repo-update still no luck.

Version

0.62.2

Output of react-native info

System: OS: macOS 12.0.1 CPU: (10) arm64 Apple M1 Pro Memory: 500.58 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 17.0.1 - /opt/homebrew/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 8.1.0 - /opt/homebrew/bin/npm Watchman: 2021.11.15.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0 Android SDK: API Levels: 23, 28, 29, 30, 31 Build Tools: 29.0.2, 29.0.3, 30.0.2, 31.0.0 System Images: android-29 | Google Play ARM 64 v8a, android-30 | Google Play ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7784292 Xcode: 13.1/13A1030d - /usr/bin/xcodebuild Languages: Java: 17.0.1 - /usr/bin/javac Python: 2.7.18 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.62.2 => 0.62.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

The project is not compiling / building.

Snack, code example, screenshot, or link to a repository

No response

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
buraky84commented, Dec 8, 2021

I have the same issue running existing project. Here are the details below.

Configuration

Apple M1 “react-native”: “0.63.4” Xcode 13.1

Error details

Error is below. My finding is no libraries are existing under DerivedData folder so i have a lot of warnings about this and the error at the end.

ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/AppAuth'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/Base64'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/CodePush'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/DoubleConversion'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/FBReactNativeSpec'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/FirebaseCore'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/FirebaseCoreDiagnostics'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/FirebaseInstallations'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/FirebaseInstanceID'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/FirebaseMessaging'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/Folly'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/GTMAppAuth'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/GTMSessionFetcher'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/GoogleDataTransport'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/GoogleSignIn'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/GoogleUtilities'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/JWT'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/Permission-Camera'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/PromisesObjC'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RCTTypeSafety'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNCAsyncStorage'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNCMaskedView'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNCPicker'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNDateTimePicker'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNDeviceInfo'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNFBApp'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNFBMessaging'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNGestureHandler'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNLocalize'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNPermissions'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNReanimated'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNSVG'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNScreens'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNSentry'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/RNShare'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/React-Core'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/React-CoreModules'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/React-RCTAnimation'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/React-RCTBlob'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/React-RCTImage'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/React-RCTLinking'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/React-RCTNetwork'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/React-RCTSettings'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/React-RCTText'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/React-RCTVibration'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/React-cxxreact'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/React-jsi'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/React-jsiexecutor'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/React-jsinspector'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/ReactCommon'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/ReactNativeART'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/SSZipArchive'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/Sentry'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/Yoga'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/appcenter-analytics'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/appcenter-core'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/appcenter-crashes'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/glog'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/nanopb'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-biometrics'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-camera'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-config'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-document-picker'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-fast-openpgp'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-image-picker'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-orientation-locker'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-plaid-link-sdk'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-safari-view'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-safe-area-context'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-slider'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-splash-screen'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-version-check'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-view-shot'
ld: warning: directory not found for option '-L/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/react-native-webview'
ld: warning: directory not found for option '-F/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/AppCenter/Analytics'
ld: warning: directory not found for option '-F/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/AppCenter/Core'
ld: warning: directory not found for option '-F/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/AppCenter/Crashes'
ld: warning: directory not found for option '-F/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/AppCenterReactNativeShared'
ld: warning: directory not found for option '-F/Users/buraky/Library/Developer/Xcode/DerivedData/Mobile-antvvcuybweqqxgnsamgxfajivpg/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/Plaid'
ld: library not found for -lAppAuth

My other findings:

  • My colleagues are able to run same app with Intel and Xcode 12.x without any modification successfully.
  • I can create & run new projects with npx react-native init ProjectName successfully
  • I can also run another existing projects successfully for newer React Native releases.

I have tried so many solutions editing Library, Framework search paths, deleting pods, node-modules, clearing caches, openng project via workspace file and trying to run from Xcode. Nothing works.

Anyone faced & solved similar issue before? Is there any modification required to run older React Native projects with M1 / Xcode 13.1?

3reactions
buraky84commented, Dec 9, 2021

Running the app with below command solved my issue. arch -x86_64 react-native run-ios

Otherwise you have to enable Rosetta for XCode and build the app only with Xcode not from the CLI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build keeps failing on React Native with m1 & BigSur
I'm trying to build a project from scratch with React Native following the guideline. After struggling for hours for just to install and...
Read more >
React Native Environment Setup for MacOS (M1 and Intel)
Follow along this tutorial to setup your React Native Environment for MacOS ( M1 and Intel) before you start building your first React...
Read more >
Adding macOS support to an existing React Native app
My understanding of this error is that there is some JS code in your app which is attempting to use a native module...
Read more >
command phasescriptexecution failed with a nonzero exit ...
One possible reason could be that Xcode is using an outdated version of Node (in my case, it was because I use nvm...
Read more >
Setting Up React Native in Mac M1. - Dev Genius
npm install -g react-native-cli · Create a new app ; react-native init zippy. After creating this go to the ios folder and hit...
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