Unity Vuforia Xcode构建错误:“架构arm64的未定义符号”
问题描述:
我目前正试图在Xcode中构建一个项目(以前工作过)。这是一个使用Vuforia插件的Unity项目,它完美地构建到了Android上。Unity Vuforia Xcode构建错误:“架构arm64的未定义符号”
在Xcode建设当我收到以下错误信息:
Undefined symbols for architecture arm64:
"_UnityRenderBufferMTLTexture", referenced from:
PlatformiOS::setRenderBuffers(void*) in libVuforiaUnityPlayer.a(PlatformiOS.o)
"_UnityCurrentMTLCommandEncoder", referenced from:
PlatformiOS::setRenderBuffers(void*) in libVuforiaUnityPlayer.a(PlatformiOS.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我已经包括Security.framework和SystemConfiguration.framework项目。
Unity 5.5.0f3; Vuforia SDK v5.5.9; XCode 8.2.1
答
我通过更新Unity项目中的Vuforia来解决了这个问题,但是在更新之前,我并未删除Plugins文件夹中的Vuforia文件。我以前尝试过对Vuforia进行适当的更新,但失败了。
所以步骤: 1 - 删除资产/ Vuforia
2 - 更新VuforiaCamera.cs(资产/脚本/ Vuforia),以下面的代码
3 - 导入最新Vuforia包
4 - 利润!
public class VuforiaCamera : MonoBehaviour
{
private bool mVuforiaStarted = false;
void Start()
{
VuforiaARController vuforia = VuforiaARController.Instance;
if (vuforia != null)
vuforia.RegisterVuforiaStartedCallback(StartAfterVuforia);
}
private void StartAfterVuforia()
{
mVuforiaStarted = true;
SetAutofocus();
}
void OnApplicationPause(bool pause)
{
if (!pause)
{
// App resumed
if (mVuforiaStarted)
{
// App resumed and vuforia already started
// but lets start it again...
SetAutofocus(); // This is done because some android devices lose the auto focus after resume
// this was a bug in vuforia 4 and 5. I haven't checked 6, but the code is harmless anyway
}
}
}
private void SetAutofocus()
{
if (CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO))
{
Debug.Log("Autofocus set");
}
else
{
// never actually seen a device that doesn't support this, but just in case
Debug.Log("this device doesn't support auto focus");
}
}
}
什么版本的Vuforia有“VuforiaCamera.cs”?即时通讯使用6.2.10,并没有VuforiaCamera更新 –
@DanielArantesLoverde我面临同样的问题。我没有在那里看到任何vuforiacamera脚本。你如何解决这个问题。请帮忙 – vanshika
@vanshika对不起,我不记得我做了什么。但是我可能会改变Unity版本,或者从零开始重做这个项目......如果我记得,我会在这里发布,但可能我会重新制作它 –