f111fei / react-native-unity-view

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

Undefined symbols for architecture arm64: #112

Open ziyoshams opened 5 years ago

ziyoshams commented 5 years ago

I have been using this package in another project successfully. But, I can't run it on my new project. Anyone has seen this error before?

ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/.../ios/UnityExport/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_ARAnchor", referenced from:
      objc-class-ref in ARSessionNative.o
  "_OBJC_CLASS_$_ARImageAnchor", referenced from:
      objc-class-ref in ARSessionNative.o
  "_OBJC_CLASS_$_AROrientationTrackingConfiguration", referenced from:
      objc-class-ref in ARSessionNative.o
  "_OBJC_CLASS_$_ARPlaneAnchor", referenced from:
      objc-class-ref in ARSessionNative.o
  "_OBJC_CLASS_$_ARReferenceImage", referenced from:
      objc-class-ref in ARSessionNative.o
  "_OBJC_CLASS_$_ARSession", referenced from:
      objc-class-ref in ARSessionNative.o
  "_OBJC_CLASS_$_ARWorldTrackingConfiguration", referenced from:
      objc-class-ref in ARSessionNative.o
  "Geo::GetiOSAppDocumentsDir()", referenced from:
      Geo::PathUtils::GetSandboxDataPath() in libiPhone-lib.a(GeoPathUtils.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I tried changing universal to arm64 architecture in Player Settings, but didn't work. Any hints, tips, suggestions is appreciated. Thanks.

honeyp0t commented 5 years ago

I've seen a similar error in my project. Could it be related to dead code stripping? Try turning it on or building in release mode and see if that helps.

ziyoshams commented 5 years ago

@honeyp0t I've tried that, doesn't work.

ACacho22 commented 5 years ago

Hi, go to General on your project panel and scroll down to Linked Frameworks and Libraries. Add ARKit's framework to your list

ntsd commented 5 years ago

Same as me. it works without arm64. Look like the export lib isn't supporting for arm 64 now I'll try updating unity to latest

ziyoshams commented 5 years ago

Hi, go to General on your project panel and scroll down to Linked Frameworks and Libraries. Add ARKit's framework to your list

Is it in Xcode?

ntsd commented 5 years ago

I pass this error now. if you're using Simulator. Just change Target SDK setting to Simulator before build.

ziyoshams commented 5 years ago

I can't seem to pass this error. And ARKit is in my Linked Libraries. @ntsd I think the docs say not to run on simulator.

Screen Shot 2019-05-22 at 12 10 55 PM
ACacho22 commented 5 years ago

Hi, go to General on your project panel and scroll down to Linked Frameworks and Libraries. Add ARKit's framework to your list

Is it in Xcode?

Yes it is. Anytime you see errors like the one listed it's because XCode is missing the referenced framework. ARKit should be searchable when you add to the target's listed frameworks.

DaveAdams88 commented 5 years ago

Same as me. it works without arm64. Look like the export lib isn't supporting for arm 64 now I'll try updating unity to latest

Im using ARFoundation with ARKit in unity which requires arm64, how would I go about getting this to work? I am having similar errors to this. If someone could point me in the right direction that would be great, thanks!

Versions im using:

Unity 2018.3.1 ARFoundation 1.5.0 - preview5 ARKIT XR Plugin - 2.2.0 preview1 Xcode 10.2.1

vlobanov commented 5 years ago

@DaveAdams88 Maybe try ARFoundation & ARKit XR version 2.1? Because 2.2 requires ios 13 & xcode 11