ios - 优化 - 步进可能表现得很奇怪 : iOS/Unity

标签 ios swift unity3d optimization

我正在尝试将 unity 集成到 iOS 应用程序中。我已遵循本教程 http://www.agnosticdev.com/blog-entry/swift/integrating-unity-and-vuforia-ios-swift-project

集成后,当我启动我的应用程序时,它会崩溃并在控制台上显示此错误:是使用优化编译的 - 步进可能表现得很奇怪;变量可能不可用。

崩溃: Crash log

我尝试用谷歌搜索并找到了这些链接:

  1. APPNAME was compiled with optimization - stepping may behave oddly; variables may not be available
  2. 'Project Name' was compiled with optimization - stepping may behave oddly; variables may not be available
  3. Xcode target compiled with optimization
  4. Xcode: Cannot set optimization level for debug

没有任何改变。

我更改了项目和 pod 的优化级别。 我还将这一行添加到 pod 文件中:project 'MyProject', 'Debug - local'=>:debug, 'Debug - staging'=>:debug, 'Debug - PRODUCTION'=>:debug(在目标“项目名称”之前)

此外,我还取消选中 Strip Engine Code in unity。

我该怎么做才能克服这个错误? 任何帮助将不胜感激,谢谢。

最佳答案

您正在调试的代码是 IL2CPP 代码,它很可能在预构建的优化库中(可能在 libiPhone-lib.a 中)。您的build设置只会影响您的 xcode 项目中正在编译的代码,因此它们不会影响预构建的库。要消除警告,您需要重建该库,并且需要 Unity 源代码来执行此操作。

更重要的是,这不是崩溃的原因。它只是告诉您,找到崩溃的根源将变得更加困难。

看起来它正在调用一个名为 LoadMetadataFile 的函数并在访问返回值时崩溃。您或许可以在该函数调用上设置一个断点,并查看它的进出情况,以找到下一个调试步骤(突出显示的崩溃行上方 5 行的 bl 指令)。

以下是一些可能对您有所帮助的文档: Apples 调用约定文档: https://developer.apple.com/library/content/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html

Arm指令引用(打开到崩溃指令):http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0802a/LDRSW_imm.html

关于ios - 优化 - 步进可能表现得很奇怪 : iOS/Unity,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45078851/

相关文章:

ios - iOS Swift 导航中的 Material 组件

ios - 如何在 Swift 中解析来自 Alamofire API 的 JSON 响应?

c# - Unity构建和运行游戏错误: Error building Player: Extracting referenced dlls failed

ios - iOS中不同位置的商店数据库有什么区别?

ios - phonegap 应用程序中的随机白色闪光

ios - Swift 编译器错误 : "Expression too complex" on a string concatenation

iOS Swift 在 Debug-iphoneos 中没有这样的文件或目录

c# - Unity IsPointerOverGameObject 问题

android - Unity Firebase Invites 抛出异常ApplicationException: internal::IsInitialized()

iOS 构建失败,签名无效 : 0x80014 while unzipping the iOS device build zip file from the server (containing the . plist 和 .ipa 文件)