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.

Fail to build using Xcode 12 Beta 4

See original GitHub issue

Description

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.

  1. Add native dependencies to package.json;
  2. Install dependencies using yarn install;
  3. Run pod install in ios folder to auto link native dependencies;
  4. 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:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:52 (21 by maintainers)

github_iconTop GitHub Comments

42reactions
alloycommented, Sep 17, 2020

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 the React-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 to React-Core:

-  s.dependency 'React'
+  s.dependency 'React-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.)

10reactions
xxsnakerxxcommented, Oct 8, 2020
find ./node_modules -type f -name '*.podspec' | xargs sed -i.sed -e "s%'%\"%g"
find ./node_modules -type f -name '*.podspec' | xargs sed -i.sed -e 's%s.dependency[\t ]*"React"%s.dependency "React-Core"%g'
Read more comments on GitHub >

github_iconTop 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 >

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