我使用 Google Cardboard 开始了我的项目,然后导入了新的 GoogleVR 包来替换它。当我在 Unity 中播放时,我的项目工作正常,但当我尝试为 iOS 构建它时,我在 Xcode 项目和 Unity Cloud 构建项目上都会出现错误。
在 Xcode 上:
ld: warning: arm64 function not 4-byte aligned: ltmp0 from /Users/gamedev/Desktop/VR1-iOS/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/gamedev/Desktop/VR1-iOS/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
Undefined symbols for architecture arm64:
"_endSettingsDialog", referenced from:
-[DismissDialogViewController viewDidAppear:] in libvrunity.a(unity.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Unity 云构建:
[xcode] Undefined symbols for architecture armv7:
9352: [xcode] "_endSettingsDialog", referenced from:
9353: [xcode] -[DismissDialogViewController viewDidAppear:] in libvrunity.a(unity.o)
9354: [xcode] "_isOpenGLAPI", referenced from:
9355: [xcode] RegisterMonoModules() in RegisterMonoModules.o
9356: [xcode] ld: symbol(s) not found for architecture armv7
9357: [xcode] clang: error: linker command failed with exit code 1 (use -v to see invocation)
9358: [xcode] Showing first 200 warnings only
9359: [xcode] ** ARCHIVE FAILED **
9360: [xcode] The following build commands failed:
9361: [xcode] Ld /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-gccgnjkpqhormzcosgksevxlzeea/Build/Intermediates/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/APPLICATION_PATH/vr1.app/vr1 normal armv7
9362: [xcode] (1 failure)
我注意到此类问题的大多数答案都涉及 SourceTree(这就是我正在使用的)在推送源代码时忽略 .dll 文件。目前我的工作目录中没有任何 .gitignore 文件。
更新 我已经升级到Unity 5.6,错误发生了一些变化:
"_endSettingsDialog", referenced from:
-[DismissDialogViewController viewDidAppear:] in libvrunity.a(unity.o)
Undefined symbols for architecture arm64:
"_isOpenGLAPI", referenced from:
_iOSDevice_isOpenGLAPI_m3529398287 in Bulk_Assembly-CSharp_0.o
(maybe you meant: _iOSDevice_isOpenGLAPI_m3529398287)
ld: symbol(s) not found for architecture arm64
在检查链接的库(在build设置中)时,我注意到我同时拥有 libvrunity.a
和 libgvrunity.a
所以我删除了第一个,错误是消失了,但我还有第二个关于OpenGL的。奇怪的是,该项目在统一中完美运行。
最佳答案
显然这都是关于 Google VR SDK 的。当前版本 1.30 不支持 Unity 5.6 中的 native iOS。
他们解决这个问题的唯一方法是:
- 在我的项目中删除 GoogleVR 插件(及其所有引用)
- 用简单的光线转换替换 GazeVR View 跟踪,以便激活用户正在寻找的对象上的特定方法
- 导出到 iOS 时在“build设置”中激活虚拟模式
- 从 XCode 项目中删除
libvrunity.a
和libgvrunity.a
库 - 确保将位码支持设置为“否”
- 将 GoogleVR 导入为 cocoapod。
不幸的是,这个过程阻止我在 Unity 编辑器中显示立体 View 。
我们需要等待 1.40 更新。我已经开通了issue on GoogleVR GitHub repository 。
关于ios - 从 Google Cardboard 升级到 Google VR 的项目在 Unity 中运行,但在构建 iOS(XCode 或 Unity Cloud Build)时失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43114648/