我使用 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)
我注意到这类问题的大多数答案都是指在推送源代码时忽略 .dll 文件的 SourceTree(这是我正在使用的)。目前我的工作目录中没有任何 .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
在检查链接的库之间(在构建设置中)时,我注意到我两者都有libvrunity.a
,libgvrunity.a
所以我删除了第一个并且错误消失了,但我仍然有关于 OpenGL 的第二个。奇怪的是,该项目完美地统一工作。