xcode - Unity Xcode 项目 PlayerSettings_GetBundleIdentifier

标签 xcode unity-game-engine 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 的 undefined symbol 通常指向尚未包含的框架,但这些引用指向 PlayerSettings_GetBundleIdentifier,据我所知,这是 Unity 属性。

此外,当在 XCode 中设置包标识符、版本和构建时:

Xcode Bundle Identfier

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

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

最佳答案

出现此问题的原因是 VoxelBusters 中引用的 3 个方法在随插件提供的任何 .h 和 .m 文件中都不存在。使用 __Internal DLLImport 将方法链接到 Objective-C 代码。

[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 项目中不存在。当我从 Unity 将这些方法添加到 AppDelegate.h 和 AppDelegate.m 时,错误消失了,现在我可以继续工作。

关于xcode - Unity Xcode 项目 PlayerSettings_GetBundleIdentifier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41124784/

相关文章:

ruby-on-rails - 首次 bundle 安装,堆栈级别太深

ios - 为什么我的启动图像后面有一个拉伸(stretch)的图标图像,如何摆脱它?

iPhone 存储大量图像

xcode - 我如何告诉我的 UITextField(代码)放弃第一响应者?

android - Unity 应用程序在 Google Tango 设备上崩溃

unity-game-engine - 简单地获取 Cg 着色器内对象的缩放

ios - 桥接 AWS SDK 上的 XCode 错误

android - Unity3d FB.canvas.pay Android 和 iOS 的替代方案

osgi - 如何在 Apache Felix OSGi Framework 中更新 Bundle

mysql - 制作新的 Rails 应用程序时出错