iOS在Unity / Xcode上的构建失败

时间:2019-06-25 07:48:29

标签: xcode unity3d augmented-reality setup-project

我目前正在尝试建立一个Unity项目,该项目针对VR进入iOS的AR。我正在使用AR Foundation插件+ ARKit / ARCore插件。尝试使用XCode构建它并在我的iPhone上运行,但出现这些错误。不确定如何修复它们。

试图更改一系列播放器设置。

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)

2 个答案:

答案 0 :(得分:1)

如果您使用的是最新的Unity ARKit软件包,则需要XCode 11和iOS 13,因为它们都支持ARKit3。我遇到了类似的问题,并且获得了XCode和iOS的Beta版才能运行。

答案 1 :(得分:1)

我在项目中解决了这个问题。 (感谢@saif提供Unity forum link

罪魁祸首是Unity中错误的ARkit XR插件版本,该尝试使用Xcode的更高版本的AR Kit中的功能,从而在此处给出了相关的错误。

我设法进入设置(适用于2018.4.x版中的版本)

  • Unity 2018.4.5f1
  • AR Foundation 1.5.0-preview.6
  • AR子系统2.2.0-preview.3
  • ARKit XR插件2.1.1(从2.1.0-preview.5更新)
  • XCode 10.3(构建到iOS 12.4设备)

如果您运行带有AR Foundation 2.x的Unity 2019.x,则可能要找到正确的ARKit XR插件,如here in the AR Foundation samples on Github所示