jiulongw / swift-unity

Sample code that integrate Unity (2017.1+) scene into iOS (Swift 4.0, Xcode 9+) project.
390 stars 100 forks source link

Using ARKit in Unity #96

Closed KevinHuyskens closed 6 years ago

KevinHuyskens commented 6 years ago

Has anyone tried doing this while using ARKit in Unity ( I need it for the graphic capabilities from Unity). I can't get it to work, followed everything step by step but when trying to build I get an error in the ARNativeSession.mm (unity created this class). The function that checks for face tracking support requires a returned bool but in that function there isn't always a bool returned so I tried changing it. Every time I try building, it automatically changes back.

KevinHuyskens commented 6 years ago

Oke got past that issue by setting the apple clang warning for mismatched return type to YES instead of YES_ERROR but now I get the following: Undefined symbols for architecture arm64: "_OBJCCLASS$_ARReferenceImage", referenced from: objc-class-ref in ARSessionNative.o "_OBJCCLASS$_ARSession", referenced from: objc-class-ref in ARSessionNative.o "_OBJCCLASS$_ARWorldTrackingConfiguration", referenced from: objc-class-ref in ARSessionNative.o "_OBJCCLASS$_AROrientationTrackingConfiguration", referenced from: objc-class-ref in ARSessionNative.o "_OBJCCLASS$_ARAnchor", referenced from: objc-class-ref in ARSessionNative.o "_OBJCCLASS$_ARImageAnchor", referenced from: objc-class-ref in ARSessionNative.o "_OBJCCLASS$_ARPlaneAnchor", referenced from: objc-class-ref in ARSessionNative.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

KevinHuyskens commented 6 years ago

Okay, got it to work .... Just had to add the arkit framework... this is an important detail tho, you have to add the framework from extern libraries!