Unity 打包IOS平台错误

本文解决Unity打包时出现的BulidFailed问题,包括如何处理ulua.dll文件冲突,解决DXT5纹理压缩不支持iPhone的问题,以及Xcode下编译时的签名配置和bitcode缺失等问题。

1、Unity 下打包


Bulid Failed
Assets/Plugins/uLua/x86_64/ulua.dll would be copied to /ulua.dll

Plugin ‘ulua.dll’ is used from several locations:
Assets/Plugins/uLua/x86_64/ulua.dll would be copied to /ulua.dll
Assets/Plugins/uLua/x86/ulua.dll would be copied to /ulua.dll
Please fix plugin settings and try again.

UnityEditor.Modules.DefaultPluginImporterExtension:CheckFileCollisions(String)
UnityEditorInternal.PluginsHelper:CheckFileCollisions(BuildTarget) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Plugins/PluginsHelper.cs:25)
UnityEditor.HostView:OnGUI()

解决:
http://doc.ulua.org/article/faq/pluginuluadllisusedfromserverallocations.html

Plugin ‘ulua.dll’ is used from serveral locations
Assets/Plugins/xxx/ulua.dll would be copied to /ulua.dll 解决方案:

如果是32位Unity编辑器,删掉x86_64目录,如果是64位编辑,删除x86目录即可。


DXT5 compressed textures are not supported when publishing to iPhone
Bulid Success 但仍然有错误,这些问题可能导致游戏闪退

DXT5 compressed textures are not supported when publishing to iPhone
Assets/FX/textures/daoguang/daoguang_00019.dds
Included from scene:
UnityEditor.HostView:OnGUI()

DXT5 纹理压缩时不支持发布iPhone

暂时解决方案:
删除这种纹理贴图



2、Xcode下编译


Signing for “Unity-iPhone” requires a development team. Select a development team in the project editor.
Code signing is required for product type ‘Application’ in SDK ‘iOS 10.3’

原因:
没有在Signing team里面添加签名信息

解决:
xcode7.0开始就可以免证书真机调试
Unity发布至IOS的流程(踩坑记录)
xcode8.2 免证书手机调试详解


ld:’/…/Libraries/Plugins/uLua/iOS/libulua.a(array.o)’ does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

iOS中关于bitcode没有被包含的解决方法:http://www.jianshu.com/p/9eb11e365312
Xcode7 does not contain bitcode. 的错误:http://blog.youkuaiyun.com/lwuit/article/details/48783885


‘XXXX’ was compiled with optimization - stepping may behave oddly; variables may not be available

工程在编译之后被优化了,所以导致单步的时候程序表现异常,变量也都不能访问了。这是由于编译的时候选择的是 release,而 release 的时候是会做很多优化,导致上述结果。

解决方法

http://blog.youkuaiyun.com/zhyl8157121/article/details/48780897

把编译方式改为Debug。
1、
这里写图片描述
2、
这里写图片描述
3、
这里写图片描述


在Windows平台上使用Unity进行iOS应用打包,虽然Unity官方推荐使用macOS环境进行iOS打包,但通过Windows平台也可以完成Xcode工程的生成,后续则需借助Mac设备完成最终的编译与发布。以下是具体流程: 1. **Unity项目配置** 在Unity编辑器中打开项目后,进入 **File > Build Settings**,在平台列表中选择 **iOS**,点击 **Switch Platform** 以切换至iOS构建环境。确保Unity版本为5.X.X或更高版本,以支持更完善的iOS打包功能[^1]。 2. **调整Player Settings** 在 **Edit > Project Settings > Player Settings** 中设置iOS相关的参数,包括: - **Bundle Identifier**:填写与苹果开发者账户中一致的App ID。 - **Version**:设定应用版本号。 - **Build**:每次发布时递增的内部版本号。 - **SDK Version**:选择使用设备SDK或模拟器SDK。 - **Architecture**:默认为ARM64,可根据需求添加其他架构。 3. **导出Xcode工程** 在 **Build Settings** 界面中点击 **Build**,选择一个目标文件夹用于导出Xcode工程。Unity将在此目录下生成完整的Xcode项目文件,包含所有必要的资源和原生代码集成[^1]。 4. **将Xcode工程迁移至Mac平台** 由于最终的编译和签名必须在macOS上通过Xcode完成,因此需要将导出的Xcode工程复制到Mac设备上。可以通过共享文件夹、外部存储设备或版本控制系统进行迁移。 5. **在Xcode中配置签名与发布设置** 打开Xcode项目后,进行以下操作: - 在 **Signing & Capabilities** 标签页中选择团队(Team),Xcode将自动管理Provisioning Profile。 - 确保 **Bundle Identifier** 与开发者账户中注册的一致。 - 若接入广告平台(如AdMob),需在 **Info.plist** 中添加应用ID: ```xml <key>GADApplicationIdentifier</key> <string>ca-app-pub-247657524254~5456456454</string> ``` 该配置用于标识广告应用,避免运行时错误[^3]。 6. **构建与归档** 使用Xcode连接真机设备,选择设备作为目标并点击 **Build** 以确保项目可成功编译。随后选择 **Product > Archive** 进行归档,归档完成后可通过 **Organizer** 提交至App Store或导出IPA文件用于测试。 7. **IPA重签名(可选)** 若需对IPA文件进行重签名,可在Windows环境下使用 **iReSign** 工具。操作步骤如下: - 填写IPA文件路径。 - 指定从苹果开发者后台下载的签名证书。 - 输入用于创建证书的Apple ID。 - 选择对应的证书并点击重新签名[^2]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值