f111fei / react-native-unity-view

Show an unity view in react native
MIT License
401 stars 102 forks source link

Error using react-native 0.51.0 #96

Closed Ryan-Nichol closed 5 years ago

Ryan-Nichol commented 5 years ago

I have a current project which requires me to use react-native 0.51.0

However I can not get unity-view to run on 0.51.0, I get 65 errors of undefined symbols from the Yoga directory (node_modules/react-native/ReactCommon/yoga/yoga). It works in later versions.

ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/yourplayer/Documents/GitHub/yourplayer-3d-avatar-rn/ios/UnityExport/Libraries/libiPhone-lib.a(unwind_test_arm64.o) Undefined symbols for architecture arm64: "YGNode::resolveFlexBasisPtr() const", referenced from: YGNodeComputeFlexBasisForChild(YGNode*, YGNode*, float, YGMeasureMode, float, float, float, YGMeasureMode, YGDirection, YGConfig*) in libReact.a(Yoga.o) "YGFloatOptionalMax(YGFloatOptional const&, YGFloatOptional const&)", referenced from: YGNodeComputeFlexBasisForChild(YGNode*, YGNode*, float, YGMeasureMode, float, float, float, YGMeasureMode, YGDirection, YGConfig*) in libReact.a(Yoga.o) "YGNode::setLayoutComputedFlexBasisGeneration(unsigned int)", referenced from: YGNodeComputeFlexBasisForChildren(YGNode*, float, float, YGMeasureMode, YGMeasureMode, YGDirection, YGFlexDirection, YGConfig*, bool, float&) in libReact.a(Yoga.o) YGNodeComputeFlexBasisForChild(YGNode*, YGNode*, float, YGMeasureMode, float, float, float, YGMeasureMode, YGDirection, YGConfig*) in libReact.a(Yoga.o) "YGNode::setLayoutComputedFlexBasis(YGFloatOptional const&)", referenced from: YGNodeComputeFlexBasisForChildren(YGNode*, float, float, YGMeasureMode, YGMeasureMode, YGDirection, YGFlexDirection, YGConfig*, bool, float&) in libReact.a(Yoga.o) YGNodeComputeFlexBasisForChild(YGNode*, YGNode*, float, YGMeasureMode, float, float, float, YGMeasureMode, YGDirection, YGConfig*) in libReact.a(Yoga.o) "YGNode::getTrailingPaddingAndBorder(YGFlexDirection const&, float const&) const", referenced from: YGNodePaddingAndBorderForAxis(YGNode*, YGFlexDirection, float) in libReact.a(Yoga.o) YGJustifyMainAxis(YGNode*, YGCollectFlexItemsRowValues&, unsigned int const&, YGFlexDirection const&, YGFlexDirection const&, YGMeasureMode const&, YGMeasureMode const&, float const&, float const&, float const&, float const&, float const&, bool const&) in libReact.a(Yoga.o) "YGStyle::YGStyle()", referenced from: YGNode::YGNode() in libReact.a(Yoga.o) "YGFloatOptional::operator+(YGFloatOptional const&)", referenced from: _YGNodeCalculateLayout in libReact.a(Yoga.o) YGNodePaddingAndBorderForAxis(YGNode*, YGFlexDirection, float) in libReact.a(Yoga.o) it goes on.....

The lowest working version I tried was react-native 0.53.0 and I noticed that the yoga files are different compared to the ones installed using react-native 0.51.0. I am unsure if this is the problem, but if you think you have an idea or solution to make it work that would be much appreciated!

Versions: React-native 0.51.0 React 16.2.0 React-native-unity-view 1.3.3 Xcode 10.1

JanOwiesniak commented 5 years ago

react-native 0.51.0 latest commit is from 6 Dec 2017. react-native 0.59.1 is already out there. Is there any particular reason why you are using an one year old react-native version? If not, just ignore it and go with 0.53.0 (or higher) :)