美文网首页
Unity iOS工程报错解决:Undefined symbol

Unity iOS工程报错解决:Undefined symbol

作者: 翔味鸡丁 | 来源:发表于2020-05-30 21:09 被阅读0次

```

Undefined symbols for architecture arm64:

  "_OBJC_CLASS_$_ARObjectScanningConfiguration", referenced from:

      objc-class-ref in ARKitNativeObjectDetection.o

  "_OBJC_CLASS_$_ARObjectAnchor", referenced from:

      objc-class-ref in ARKitNativeObjectDetection.o

  "_OBJC_CLASS_$_ARPointCloud", referenced from:

      objc-class-ref in ARPointCloud.o

  "_OBJC_CLASS_$_AREnvironmentProbeAnchor", referenced from:

      objc-class-ref in ARSessionNative.o

      objc-class-ref in AREnvironmentProbe.o

  "_OBJC_CLASS_$_ARWorldTrackingConfiguration", referenced from:

      objc-class-ref in ARSessionNative.o

  "_OBJC_CLASS_$_ARReferenceImage", referenced from:

      objc-class-ref in ARSessionNative.o

  "_OBJC_CLASS_$_AROrientationTrackingConfiguration", referenced from:

      objc-class-ref in ARSessionNative.o

  "_OBJC_CLASS_$_ARImageAnchor", referenced from:

      objc-class-ref in ARSessionNative.o

  "_OBJC_CLASS_$_ARAnchor", referenced from:

      objc-class-ref in ARSessionNative.o

  "_OBJC_CLASS_$_ARWorldMap", referenced from:

      objc-class-ref in ARWorldMap.o

      objc-class-ref in ARSessionNative.o

      objc-class-ref in ARKitNativeObjectDetection.o

  "_OBJC_CLASS_$_ARPlaneAnchor", referenced from:

      objc-class-ref in ARSessionNative.o

  "_OBJC_CLASS_$_ARSession", referenced from:

      objc-class-ref in ARSessionNative.o

  "_OBJC_CLASS_$_ARReferenceObject", referenced from:

      objc-class-ref in ARWorldMap.o

      objc-class-ref in ARSessionNative.o

      objc-class-ref in AREnvironmentProbe.o

      objc-class-ref in ARKitNativeObjectDetection.o

ld: symbol(s) not found for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

```

解决方案:

解决步骤1 解决步骤2

以上2步就应该能解决这个问题了。

解决思路:

思路最重要,渔和鱼的区别。

首先我们看报错:

Undefined symbols for architecture arm64:

这句一般是因为库出问题导致的,有多种可能,这里说的是架构问题,找不到arm64的。

再看下一句:

  "_OBJC_CLASS_$_ARObjectScanningConfiguration", referenced from:

      objc-class-ref in ARKitNativeObjectDetection.o

我的理解是,这里说ARKitNativeObjectDetection这个类,在arm64架构下,找不到ARObjectScanningConfiguration这个东西。

我们进入ARKitNativeObjectDetection这个类搜索一下ARObjectScanningConfiguration:

进入这个类,鼠标在ARObjectScanningConfiguration,按住command点进去看下 发现来到了这里,系统的ARKit库

既然这里用到了ARKit,而且报错说这里有问题,直觉告诉我可能是这个库没有引入。

在报错的UnityFramework里面,果然发现没有引入ARKit

所以直接引入ARKit就行了。

PS:我也不知道为啥我生成的Unity工程没有ARKit,可能有啥地方出问题了吧。

解决思路就是这个,网上搜到的很多答案都是直接说怎么做,很少说为什么,希望大家能分享下自己的思路。嗯,就这样吧。

相关文章

网友评论

      本文标题:Unity iOS工程报错解决:Undefined symbol

      本文链接:https://www.haomeiwen.com/subject/qlkzdctx.html