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.

XCode 13 can not link/find third party .a when build with simulator

See original GitHub issue

Description

I recently moved a old project from macbook pro 2017 to an Apple M1 chip Mac Mini XCode13. When I build my project with simulator it failed and error occurs: clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libRNBackgroundTimer.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libRCTImageMarker.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libNfcManager.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libBleManager.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libReactNativeAudioToolkit.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libART.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libRCTAnimation.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libRCTActionSheet.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libRCTGeolocation.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libRCTImage.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libRCTLinking.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libRCTNetwork.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libRCTSettings.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libRCTText.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libRCTVibration.a' clang: error: no such file or directory: '/Users/symous/Library/Developer/Xcode/DerivedData/symousReact-hgljttfucnynuifixuyfjnjgdbct/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a' Command Ld failed with a nonzero exit code

it seems like that some of my third party .a lib can not be linked/found, but all is working fine when I build with physical device and archive.

I have searched lots of related issue and guess that’s maybe an issue of architecture settings, I have configured: image

Version

0.59.0

Output of react-native info

React Native Environment Info: System: OS: macOS 12.0.1 CPU: (8) x64 Apple M1 Memory: 21.61 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 14.18.0 - /usr/local/bin/node npm: 6.14.15 - /usr/local/bin/npm Watchman: 2021.10.04.00 - /opt/homebrew/bin/watchman SDKs: iOS SDK: Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0 Android SDK: API Levels: 25, 26, 27, 28, 29, 31 Build Tools: 25.0.2, 28.0.3, 29.0.2, 29.0.3, 31.0.0 System Images: android-25 | Google APIs ARM 64 v8a, android-29 | Google APIs ARM 64 v8a, android-31 | Google APIs ARM 64 v8a IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7678000 Xcode: 13.1/13A1030d - /usr/bin/xcodebuild npmPackages: react: ^16.8.3 => 16.8.3 react-native: ^0.59.0 => 0.59.0

Steps to reproduce

just like below.

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

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

5reactions
Symouscommented, Nov 17, 2021

@Lacerda53 @skibaalex Just have found that we need to do nothing except use rosetta to run Xcode.

  1. view XCode in finder.
  2. right click and get info.
  3. check “open using rosetta”

restart XCode. 😃

0reactions
github-actions[bot]commented, May 18, 2022

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xcode 13 cannot run project genera… - Apple Developer
Usual projects created with Xcode 12.5.1 build and run without any issues using Xcode 13. Does your project have any third party libraries?...
Read more >
Migrating your iOS projects and CI/CD to M1 Macs
Tips, tricks, and necessary steps to migrate your iOS project and its CI/CD pipeline to Apple silicon.
Read more >
Xcode building for iOS Simulator, but linking in an object file ...
So when a simulator is chosen as the run destination, it can potentially try to compile/link your libs/apps against arm64 based simulators, as ......
Read more >
Xcode for Windows (12 Ways to Build iOS Apps on PC)
Lastly, there are many third party solutions that you can use to do iOS development on Windows. You won't be using Xcode in...
Read more >
Creating a Framework for iOS - RayWenderlich.com
Learn how to build an iOS framework, which lets you share code between apps, modularize your code or distribute it as a third-party...
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