monochromatic
monochromatic

Reputation: 121

Build Failure for iOS on Unity/Xcode

I'm currently trying to set up a Unity project that's set up for VR into AR for iOS. I'm using the AR Foundation plugin + ARKit/ARCore plugins. Trying to build it and run on my iPhone using Xcode and I'm getting these errors.

Tried changing a bunch of player settings.

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_AREnvironmentProbeAnchor", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXREnvironmentProbeProvider.o)
  "_OBJC_CLASS_$_ARCollaborationData", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRSessionProvider.o)
  "___isPlatformVersionAtLeast", referenced from:
      _UnityARKit_Camera_AcquireConfigurations in UnityARKit.a(ARKitXRCameraProvider.o)
      _UnityARKit_Camera_TryGetCurrentConfiguration in UnityARKit.a(ARKitXRCameraProvider.o)
      _UnityARKit_Camera_TrySetCurrentConfiguration in UnityARKit.a(ARKitXRCameraProvider.o)
      (anonymous namespace)::ARKitXRCameraProvider::ResetLocalConfigurationState() in UnityARKit.a(ARKitXRCameraProvider.o)
      (anonymous namespace)::ARKitXRCameraProvider::HandleARKitEvent(UnityARKitEvent, void*, int) in UnityARKit.a(ARKitXRCameraProvider.o)
      _UnityARKit_EnvironmentProbeProvider_Construct in UnityARKit.a(ARKitXREnvironmentProbeWrapper.o)
      _UnityARKit_EnvironmentProbeProvider_Destruct in UnityARKit.a(ARKitXREnvironmentProbeWrapper.o)
      ...
  "_OBJC_CLASS_$_ARBodyAnchor", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRHumanBodyProvider.o)
  "_OBJC_CLASS_$_ARImageTrackingConfiguration", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRImageTrackingProvider.o)
  "_OBJC_CLASS_$_ARBodyTrackingConfiguration", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRHumanBodyProvider.o)
  "_OBJC_CLASS_$_ARImageAnchor", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRImageTrackingProvider.o)
  "_OBJC_CLASS_$_ARSkeletonDefinition", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRHumanBodyProvider.o)
  "_OBJC_CLASS_$_ARObjectAnchor", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRObjectTrackingProvider.o)
  "_OBJC_CLASS_$_ARReferenceImage", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRImageTrackingProvider.o)
  "_OBJC_CLASS_$_ARMatteGenerator", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRHumanBodyProvider.o)
  "_OBJC_CLASS_$_ARReferenceObject", referenced from:
      objc-class-ref in UnityARKit.a(ARKitXRObjectTrackingProvider.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Upvotes: 1

Views: 3287

Answers (2)

Dalton Lima
Dalton Lima

Reputation: 121

I solved this problem in my project. (Thanks @saif for the Unity forum link)

The culprit was a wrong ARkit XR Plugin version in Unity, which tries to use features from a later AR Kit version in Xcode thus giving those errors related here.

I manage to get working within my setup (for those in 2018.4.x)

  • Unity 2018.4.5f1
  • AR Foundation 1.5.0-preview.6
  • AR Subsystems 2.2.0-preview.3
  • ARKit XR Plugin 2.1.1 (update from 2.1.0-preview.5)
  • XCode 10.3 (building to an iOS 12.4 device)

If you are running Unity 2019.x with AR Foundation 2.x you probably want to find the correct ARKit XR Plugin as indicated here in the AR Foundation samples on Github

Upvotes: 1

Collective Mass
Collective Mass

Reputation: 11

If you are using the latest Unity ARKit package, it requires XCode 11 and iOS 13 because they are supporting ARKit 3. I had similar issues and getting the beta for XCode and iOS got it running.

Upvotes: 1

Related Questions