Skip to content

Fresh install - build fails on M1 Mac #31438

@setharell

Description

@setharell

Description

If I try build a fresh RN app for iOS, I get linking errors.

ld: warning: Could not find or use auto-linked library 'swiftFoundation'
ld: warning: Could not find or use auto-linked library 'swiftDarwin'
ld: warning: Could not find or use auto-linked library 'swiftUIKit'
ld: warning: Could not find or use auto-linked library 'swiftCoreFoundation'
ld: warning: Could not find or use auto-linked library 'swiftQuartzCore'
ld: warning: Could not find or use auto-linked library 'swiftCore'
ld: warning: Could not find or use auto-linked library 'swiftCoreGraphics'
ld: warning: Could not find or use auto-linked library 'swiftObjectiveC'
ld: warning: Could not find or use auto-linked library 'swiftDispatch'
ld: warning: Could not find or use auto-linked library 'swiftSwiftOnoneSupport'
ld: warning: Could not find or use auto-linked library 'swiftCoreImage'
ld: warning: Could not find or use auto-linked library 'swiftMetal'

There are also about 23 errors, all related to not being able to find these libraries

Undefined symbol: protocol descriptor for Swift.ExpressibleByFloatLiteral

React Native version:

System:
OS: macOS 11.2.3
CPU: (8) arm64 Apple M1
Memory: 578.42 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.0.0 - /usr/local/bin/node
Yarn: Not Found
npm: 7.10.0 - /opt/homebrew/bin/npm
Watchman: 4.9.0 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.0 => 0.64.0
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps To Reproduce

  1. npx react-native init TestProject
  2. create a .swift file in the project root, and add the bridging header
  3. clean the build folder
  4. npx react-native run-ios

Expected Results

The app should build and run on the iOS emulator

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions