Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/104.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Xcode中用于Unity演示的Google Cardbard SDK生成错误_Ios_Xcode_Unity3d_Google Cardboard - Fatal编程技术网

Ios Xcode中用于Unity演示的Google Cardbard SDK生成错误

Ios Xcode中用于Unity演示的Google Cardbard SDK生成错误,ios,xcode,unity3d,google-cardboard,Ios,Xcode,Unity3d,Google Cardboard,我正在尝试在Xcode中构建DemoScene,以便在我的iPhone 6 Plus中运行它 但它不工作,尽管我可以让它在Unity和Android上工作 有人试着做到了吗? 任何建议都是非常受欢迎的 错误消息如下所示 Undefined symbols for architecture armv7: "_InitFromUnity", referenced from: RegisterMonoModules() in RegisterMonoModules.o ld: symb

我正在尝试在Xcode中构建DemoScene,以便在我的iPhone 6 Plus中运行它

但它不工作,尽管我可以让它在Unity和Android上工作

有人试着做到了吗? 任何建议都是非常受欢迎的

错误消息如下所示

Undefined symbols for architecture armv7:
  "_InitFromUnity", referenced from:
      RegisterMonoModules() in RegisterMonoModules.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

谷歌纸板SDK(Unity插件)仅适用于Android。

虽然谷歌纸板Unity插件确实不支持iOS,但它仍然不应该无法编译。问题似乎是对一个DLL的错误引用,该DLL实际上没有包含在软件包中(可能是谷歌团队内部使用的?)

我有一个项目,我想要Android的硬纸板插件,但也需要支持其他平台(使用其他输入模式),我黑了一个这样的解决方案:

在carboard/Scripts/carboard.cs中,更改这组行

#if UNITY_IPHONE && !UNITY_EDITOR
  [DllImport("__Internal")]
#else
  [DllImport("RenderingPlugin")]
#endif
  private static extern void InitFromUnity(int textureID);
…为了这个

#if UNITY_IPHONE && !UNITY_EDITOR
    private static void InitFromUnity(int textureID) {}
#else
    [DllImport("RenderingPlugin")]
    private static extern void InitFromUnity(int textureID);
#endif
最终结果应该是一个未连接到DLL的伪函数,而不是连接到不存在的DLL的外部函数。硬纸板插件仍然不能在iOS上运行,但是您可以重新编译,而不必将其完全从项目中删除

也许在将来,谷歌可以纠正这一点(不确定报告的适当位置是…?),甚至可以添加iOS支持(如果我们幸运的话)


干杯。

只需使用Durovis Unity插件即可。它在iOS上运行得非常好。只需注释掉两行引用Android特定内容的内容。只需构建一个运行,您将看到哪些行需要注释掉

你可以在这里找到它: