Unity 构建到 xcode 并给出错误:Apple Mach-O Linker

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29203834/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 06:51:15  来源:igfitidea点击:

Unity build to xcode with gives error: Apple Mach-O Linker

xcodeunity3d

提问by Kevin Chen

I tried to google for the solution. I tried to delete the DerivedData folder but it still doesn't work... Why is this still happening? I am using Xcode version 6.2. Thanks.

我试图谷歌寻找解决方案。我试图删除 DerivedData 文件夹,但它仍然不起作用......为什么这仍然发生?我正在使用 Xcode 6.2 版。谢谢。

Edit: Under the one error has 70 different errors saying various things. There is a warning saying ld: warning: ignoring file /Users/Kevin Chen/Desktop/Parking Director/Libraries/libiPhone-lib.a, missing required architecture arm64 in file /Users/Mushrooms4Eva/Desktop/Parking Director/Libraries/libiPhone-lib.a (2 slices)

编辑:在一个错误下有 70 个不同的错误,说明了各种各样的事情。有一条警告说ld:警告:忽略文件/Users/Kevin Chen/Desktop/Parking Director/Libraries/libiPhone-lib.a,在文件/Users/Mushrooms4Eva/Desktop/Parking Director/Libraries/libiPhone-中缺少所需的架构arm64- lib.a(2 片)

All of the following links and solutions did not work for me:

以下所有链接和解决方案对我都不起作用:

https://teamtreehouse.com/forum/apple-macho-linker-error-xcode-61

https://teamtreehouse.com/forum/apple-macho-linker-error-xcode-61

Apple Mach-O Linker Error when compiling for device

为设备编译时出现 Apple Mach-O 链接器错误

采纳答案by d4Rk

Sounds like your library libiPhone-lib.ais not compiled for arm64, but your project is set to be compiled for this architecture.

听起来您的库libiPhone-lib.a未针对 编译arm64,但您的项目已设置为针对此体系结构进行编译。

I think all the errors are triggered by this "warning" as the library is ignored, and therefore you may have a lot of missing references.

我认为所有错误都是由这个“警告”触发的,因为库被忽略了,因此你可能有很多缺失的引用。

Your options:

您的选择:

  1. Get a version of the lib compiled for arm64, or do it yourself, if you have the code
  2. Remove arm64architecture from your project (which I don't recommend, as you'll need to provide an 64bit build for the App Store, but that's another story)
  1. 获取为 编译的 lib 版本arm64,或者自己动手(如果您有代码)
  2. arm64从您的项目中删除架构(我不推荐这样做,因为您需要为 App Store 提供 64 位版本,但这是另一回事)

enter image description here

在此处输入图片说明

How to make 64bit builds (available from Unity 4.6.2+)

如何进行 64 位构建(可从 Unity 4.6.2+ 获得)

  1. iOS platform
  2. Other Settings
  3. Scripting Backend => IL2CPP
  4. Architecture => Universal (to target both 32 and 64 bit)
  1. iOS平台
  2. 其他设置
  3. 脚本后端 => IL2CPP
  4. 架构 => 通用(针对 32 位和 64 位)

How to build for simulator

如何为模拟器构建

  1. Player Settings
  2. iOS platform
  3. SDK Version => Simulator SDK
  1. 播放器设置
  2. iOS平台
  3. SDK 版本 => 模拟器 SDK