Fail to build using Xcode 12 Beta 4
See original GitHub issueDescription
When I try to build a project with Xcode 12 Beta 4 to test iOS14, I got a plenty of Undefined symbols for architecture x86_64
. Every time I build the app, the list of errors is changed. Native libraries fail to recognize base React classes.
React Native version:
info Fetching system and libraries information...
(node:16978) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
System:
OS: macOS 10.15.6
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 558.54 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.3.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /Users/laigorols/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: iOS 14.0, DriverKit 20.0, macOS 11.0, tvOS 14.0, watchOS 7.0
Android SDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6626763
Xcode: 12.0/12A8179i - /usr/bin/xcodebuild
Languages:
Java: 12.0.1 - /usr/bin/javac
Python: 2.7.16 - /Users/laigorols/.pyenv/shims/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.2 => 0.63.2
npmGlobalPackages:
*react-native*: Not Found
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
- Add native dependencies to
package.json
; - Install dependencies using
yarn install
; - Run
pod install
in ios folder to auto link native dependencies; - Try to run application in simulator using Xcode;
Expected Results
Application is successfully installed and executed in simulator.
Snack, code example, screenshot, or link to a repository:
Xcode error log: Build Xcode12ReactNativeSample_2020-08-12T17-06-23.txt
Github repository with sample: https://github.com/igoriols/xcode12reactnativesample
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:52 (21 by maintainers)
Top Results From Across the Web
Xcode 12 beta 4 - error compiling for Simulator
Try upgrading the Project Xcode compatibility to Xcode 11 and change the VALIDARCHS to $(ARCHSSTANDARD). It worked for me. Posted 2 years ago...
Read more >Error building for Mac on Xcode 12 beta
I'm getting the following error when building TCA for Mac on Xcode 12 (beta 3) running on Catalina: AVAudioSession is unavailable on macOS...
Read more >How to fix the error "The developer of this app needs ...
The signature generated by a build with XCode 12.4 or lower on a Mac running with Mac OS 10.14 or lower are invalid...
Read more >Xcode 12 Beta 4 Released - Announcements
I'm facing an issue with Beta 4 (same issue in Beta 3) where I'm unable to install gems with native extensions. I'm using...
Read more >Xcode error: Failed to prepare device for development
Delete the app from the phone · Clean the Build Folder with: ⌘ + shift + K · Delete derived data · Unpair...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi all 👋
Unfortunately I only just became aware of this ticket, so my apologies for the delay but thanks for the workarounds and the patience! 🙏
I tried the reproduction kindly provided by @igoriols and was able to determine the problem. The issue is that all the podspecs of these libraries that fail to link depend on the
React
pod, which is in fact really only an umbrella dependency for pure JS applications to depend on, whereas the native APIs that these libraries rely on actually reside in theReact-Core
pod.This means that they technically were always incorrect—conceptually one should always explicitly depend on the lib that provides the APIs you rely on, rather than relying on transitive dependencies—but it seems like in previous Xcode versions the build system worked differently and having the transitive dependencies around just happened to work 🤷♂️
The correct fix going forward is for all these libs to update their dependency from
React
toReact-Core
:To unblock yourself you could use something like patch-package to temporarily hot-patch the podspecs you need, but it would be really great for the longer term and the community if you could also submit that change upstream to the respective library 🙏 (See for example this react-native-webview pull-request.)