【问题标题】:Semantic Issue: Cannot find the protocol declaration for ‘ARSessionDelegate’语义问题:找不到“ARSessionDelegate”的协议声明
【发布时间】:2017-12-20 11:55:00
【问题描述】:

有人知道Xcode 上的构建错误的解决方法吗? 欢迎所有建议。 E.G:那样不可能,Objective-C 可能,而不是Swift

环境: Swift:3.2, Xcode:9.2, Unity:2017.3.0f1, iOS:11.2.1

状况: 我正在尝试像这样使用 Swift 为 Unity 制作 Native Plugin。

Unity C# -> Objective-C -> Swift

目前,我可以通过Unity 访问 iPhone 相机胶卷。 这里的项目名称是GetDepthSample

错误详情: 在类定义中添加ARSessionDelegate 后,我收到以下错误。 CameraRollSample.swift

其他信息:

GetDepthSample-Swift.h(在 Xcode 上自动生成)显示以下错误。 GetDepthSample-Swift.h

可以跳转到协议的定义ARSessionDelegate

不仅ARSessionDelegateMetalKit也出现类似错误。

最初的 Unity 项目

https://github.com/wapa5pow/CameraRollSample

非常感谢!

【问题讨论】:

标签: ios objective-c swift xcode unity3d


【解决方案1】:

查看您在评论中发布的标题,在我看来,您可能需要在 Xcode 的项目设置中包含 ARKit 框架。虽然这通常会自动运行,但您的设置中的某些内容显然会丢失。

【讨论】:

  • 感谢您的建议。我在 Xcode -> Build Phases -> Link Binary With Libraries 中添加了 ARKit 框架。但无法修复错误。我在github上推送了最新的xcode项目。 github.com/TproJapan/GetDepthSample/tree/master/GetDepthSample
  • 无法将大尺寸的lib文件推送到github,所以我推送了我的Bitbucket代表。 bitbucket.org/Shake-Tateda/getdepthsample/src/…
  • 已修复此错误。我在 CameraRollViewControllerPlugin.mm 之上添加了 #import ,然后成功构建。但我无法在 func session(_ session: ARSession, didUpdate frame: ARFrame) 中获取 arframe 信息。关于这个问题,我将作为另一个问题发布。谢谢
  • 很高兴我能帮助找到答案:)
猜你喜欢
  • 1970-01-01
  • 2011-09-20
  • 1970-01-01
  • 1970-01-01
  • 2015-12-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多