[0.59rc2 blocking] Can't compile React Native on iOS using `-force_load` instead of `-ObjC` any more
See original GitHub issueš Bug Report
Our project canāt use the -ObjC
linker flag to discover/load all symbols as it causes āduplicate symbolā errors for some of the static libraries we use (ObjC
is all-or-nothing flag, so we canāt opt these out of it, and the āduplicate symbolsā are valid as we depend on the same shared library from multiple other libraries). As RN depends on this behaviour, the alternative is to use -force_load
for each library that needs to be loaded in this way and specify the path to the compiled (.a
) library.
With 0.58 this compiles fine, but with 0.59rc2 it results in āduplicate symbolā errors for some Yoga references in libReact.a
:
Please let me know if youād like more help looking into this issue or reproducing it - this would be a blocking issue for our project as we canāt compile with -ObjC
.
To Reproduce
-
Remove
-ObjC
from and add-force_load libReact.a
to the āLinker Flagsā section of Xcode, with the correct path tolibReact.a
(see below) -
Clean and build, error will be displayed
Iāve created a repro case: https://github.com/tomduncalf/rn0.59-force-load-bug - in the interest of keeping the project simple, the path to libReact.a
needs to be manually changed in āLinker Flagsā, you can discover it by going to ~/Library/Developer/Xcode/DerivedData
and looking for the directory starting forceLoad59rc2-....
then replacing the existing one with this path (feels like there should be a $(..)
variable pointing to this location but Iāve never found it!).
There is also a rn@0.58
branch in that repo to show it compiles OK in the current release version - you may need to āClean Build Folderā and/or clear the DerivedData folder to see the change when switching branches.
Expected Behavior
Project compiles with no errors as in 0.58
Code Example
https://github.com/tomduncalf/rn0.59-force-load-bug
Environment
System:
OS: macOS 10.14.2
CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Memory: 126.19 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.7.0 - ~/.nvm/versions/node/v10.7.0/bin/node
Yarn: 1.10.1 - ~/.yarn/bin/yarn
npm: 6.1.0 - ~/.nvm/versions/node/v10.7.0/bin/npm
Watchman: 4.7.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 10, 16, 23, 24, 26, 27, 28
Build Tools: 28.0.0, 28.0.3
System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5264788
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.1 => 16.8.1
react-native: 0.59.0-rc.2 => 0.58.5
npmGlobalPackages:
react-native-cli: 2.0.1```
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (6 by maintainers)
Top GitHub Comments
Thank you!
@kelset It still happens but I think I might know what is wrongā¦ testing something out and Iāll submit a PR if I can fix