XCode 13 can not link/find third party .a when build with simulator
See original GitHub issueDescription
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:
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:
- Created 2 years ago
- Comments:7
Top GitHub Comments
@Lacerda53 @skibaalex Just have found that we need to do nothing except use rosetta to run Xcode.
restart XCode. 😃
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.