Unity Xcode项目PlayerSettings_GetBundleIdentifier

时间:2016-12-13 15:29:27

标签: xcode unity3d bundle bundle-identifier

我目前正在尝试从Unity构建iOS应用程序,但仍然遇到这4个错误:

Undefined symbols for architecture arm64:
"_utilityBundleIdentifier", referenced from:
      _NativeBinding_utilityBundleIdentifier_m3566456099 in Bulk_Assembly-CSharp-firstpass_4.o
      _NativeBinding_GetBundleIdentifier_m2869188113 in Bulk_Assembly-CSharp-firstpass_4.o
      _PlayerSettings_GetBundleIdentifier_m1189967083 in Bulk_Assembly-CSharp-firstpass_4.o
     (maybe you meant: _NativeBinding_utilityBundleIdentifier_m3566456099)
  "_utilityBundleVersion", referenced from:
      _NativeBinding_utilityBundleVersion_m3211654534 in Bulk_Assembly-CSharp-firstpass_4.o
      _NativeBinding_GetBundleVersion_m3758909934 in Bulk_Assembly-CSharp-firstpass_4.o
      _PlayerSettings_GetBundleVersion_m1248687572 in Bulk_Assembly-CSharp-firstpass_4.o
     (maybe you meant: _NativeBinding_utilityBundleVersion_m3211654534)
  "_debugProLogMessage", referenced from:
      _NativeBinding_debugProLogMessage_m135661794 in Bulk_Assembly-CSharp-firstpass_2.o
     (maybe you meant: _NativeBinding_debugProLogMessage_m135661794)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

退出代码1 - 架构arm64的未定义符号通常指向一个尚未包含的框架,但这些引用指向PlayerSettings_GetBundleIdentifier,就我所知的Unity属性而言。

此外,当捆绑标识符,版本& build在XCode中设置:

Xcode Bundle Identfier

这些是其他链接器标志 Other Linker Flags

这个错误是什么意思?我是否忘记在Unity或XCode设置中包含框架,哪一个或哪些内容有问题?

1 个答案:

答案 0 :(得分:1)

问题出现了,因为VoxelBusters中引用的3种方法在任何.h&中都不存在。随插件提供的.m文件。使用__Internal DLLImport将方法链接到Objective-C Code。

[DllImport("__Internal")]
private static extern string utilityBundleVersion ();
[DllImport("__Internal")]
private static extern string utilityBundleIdentifier ();
[DllImport("__Internal")]
public static extern void debugProLogMessage (string _message, eConsoleLogType _type, string _stackTrace);

XCode项目中不存在。当我将这些方法添加到AppDelegate.h&来自Unity的AppDelegate.m错误消失了,现在我可以继续工作了。