Closed sflahave closed 4 years ago
Note - I was able to work around this by creating a fork of the Yoga library, and then just renaming all the seemingly important things to hopefully avoid naming collisions with the version of Yoga that React Native uses. It seems to work. Here's my fork, if anyone is interested: https://github.com/sflahave/yoga We're currently using Yoga/YogaKit 1.9.0.
Note - I was able to work around this by creating a fork of the Yoga library, and then just renaming all the seemingly important things to hopefully avoid naming collisions with the version of Yoga that React Native uses. It seems to work. Here's my fork, if anyone is interested: https://github.com/sflahave/yoga We're currently using Yoga/YogaKit 1.9.0.
It doesn't work for me, i can't create issue in project https://github.com/sflahave/yoga these variables below should be rename too? thx @sflahave
Error:
duplicate symbol _gCurrentGenerationCount in:
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/BindYoga/libBindYoga.a(BindYoga.o)
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/yoga/libyoga.a(Yoga.o)
duplicate symbol _gConfigInstanceCount in:
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/BindYoga/libBindYoga.a(BindYoga.o)
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/yoga/libyoga.a(Yoga.o)
duplicate symbol _gNodeInstanceCount in:
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/BindYoga/libBindYoga.a(BindYoga.o)
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/yoga/libyoga.a(Yoga.o)
duplicate symbol _gPrintSkips in:
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/BindYoga/libBindYoga.a(BindYoga.o)
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/yoga/libyoga.a(Yoga.o)
duplicate symbol _gPrintChanges in:
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/BindYoga/libBindYoga.a(BindYoga.o)
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/yoga/libyoga.a(Yoga.o)
duplicate symbol _gDepth in:
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/BindYoga/libBindYoga.a(BindYoga.o)
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/yoga/libyoga.a(Yoga.o)
duplicate symbol _trailing in:
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/BindYoga/libBindYoga.a(BindYoga.o)
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/yoga/libyoga.a(Yoga.o)
duplicate symbol _leading in:
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/BindYoga/libBindYoga.a(BindYoga.o)
/Users/yuyang/Library/Developer/Xcode/DerivedData/NextCode-fzfptzjxbmlwklfzggslfwwivddb/Build/Products/Debug-iphonesimulator/yoga/libyoga.a(Yoga.o)
ld: 8 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Podfile:
pod 'BindYoga', :git => 'https://github.com/sflahave/yoga.git', :tag => 'bind-yoga-1.9.0'
pod 'BindYogaKit', :git => 'https://github.com/sflahave/yoga.git', :tag => 'bind-yoga-1.9.0'
I found another way to solve this problem
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.
๐ Bug Report
Users are unable to integrate React Native into a native iOS app that already uses the YogaKit CocoaPod.
To Reproduce
Setup a new iOS app. Set it up with Cocoapods in the usual way, and add YogaKit as a pod dependency (i.e., add
pod 'YogaKit'
to your Podfile). Runpod install
. Then, follow the iOS/Swift instructions at https://facebook.github.io/react-native/docs/integration-with-existing-apps Specifically, notice that you are directed to add the following line to your Podfile:After you do that, run
pod install
again. Cocoapods won't complain. But now, try running your project in XCode 10.2 (the latest as of Apr 9, 2019). You should see a bunch of errors likeYou could try going to File -> Workspace Settings, and then switching the Build System from "New Build System (Default)" to "Legacy Build System". But that will just result in a bunch of different errors. I was able to get around this by digging into the
node_modules/react-native/ReactCommon/yoga
and adjusting the yoga.podspec by renaming that "pod" to something like "RCTYoga". So - I'm proposing that this be done in React Native, since the "yoga" library that React Native is using is apparently not interchangeable with the real Yoga library at https://github.com/facebook/yoga/Expected Behavior
Users should be able to integrate React Native even if they're already using Yoga.
Code Example
Set up a new iOS app with CocoaPods, and use the following Podfile:
Environment