找回密码
 立即注册
查看: 361|回复: 0

UE打包相关问题记录(更新中)

[复制链接]
发表于 2023-4-19 21:56 | 显示全部楼层 |阅读模式
最近在公司和老大研究UE打包到iOS设备上运行的这块内容,看是否能为部门业务所用,中间遇到的问题会在此篇记录和整理以便以后遇到相同问题能迅速解决。
<hr/>

  • Windows远程打包iOS,rsync write 问题
因为 mac 硬盘一般比较小,打包时需要将项目通过 rsync 同步到mac下,可能因为硬盘满了写不进去而出现 rsync write 问题。

  • Windows远程打包iOS 出现 MarketplaceRules.dll does not exist
dll 路径: %AppData% / local/UnrealEngine/Intermediate/Build/BuildRules
将 dll 从 win copy 到 mac 上,mac 上对应的目录如果没有则对应 log 进行创建
参考链接:1.  https://forums.unrealengine.com/t/marketplacerules-dll-does-not-exist/566285
2.  https://forums.unrealengine.com/t/i-have-a-major-problem-in-unreal-engine-5-1/749187/13

  • 证书相关错误
注意 iPhone 证书要对应 iPhone 的描述文件 Apple 的证书要对应 Apple 的描述文件
管理证书:certmgr.msc

  • Warning: unable to build chain to self-signed root for signer
根证书安装位置错误,根证书应该要安装在钥匙串中的系统那里,而不是在默认钥匙串的登录那里。

  • UE4通过Windows进行远程打包,发现报一堆 variable “***” set but not used 错误
找到Engine/Source/Programs/UnrealBuildTool 目录,UnrealBuildTool.csproj 打开工程(不要求源码版,Launcer版本也可)
定位到工程的Platform/IOS/IOSToolChain.cs文件
在文档中搜索关键词 -Wall,删掉-Wall,重新生成一下UnrealBuildTool
参考链接:https://zhuanlan.zhihu.com/p/538137085

  • UE4源码版在xcode编译报错 “***”set but not used -Wunused-but-set-variable 解决方案
定位配置文件 Engine/Source/Programs/UnrealBuildTool/Platform/Mac/MacToolChain.cs
找到如下代码:
Result += " -Wall -Werror";
在其下方插入代码:
Result += " -Wno-unused-but-set-variable";
编译前先备份并删除如下两个目录(默认位置):
Engine/Source/Programs/UnrealBuildTool/obj/Development
Engine/Source/Programs/DotNETCommon/DotNETUtilities/obj/Development
因为引擎安装完成后,会对UnrealBuildTool的相关执行文件设置只读权限,阻碍编译过程。
使用Rider重新编译UnrealBuildTool
Engine/Source/Programs/UnrealBuildTool/UnrealBuildTool.csproj
参考链接:https://blog.csdn.net/fhydralisk/article/details/126137827

  • UE源码版在Mac上编译执行 GenerateProjectFiles 脚本遇到 SDK not found 问题
终端执行 sudo xcode-select -r 问题解决

  • UE4源码版在xcode编译报错 variable 'v'is uninitialized when passed as a const reference argument here 解决方案
"\Engine\Source\Programs\UnrealBuildTool\Platform\Mac\MacToolChain.cs"里面
GetCompileArguments_Global方法增加以下代码:
Result += " -Wno-uninitialized-const-reference";
使用Rider重新编译UnrealBuildTool
Engine/Source/Programs/UnrealBuildTool/UnrealBuildTool.csproj
参考链接:https://zhuanlan.zhihu.com/p/392141394

  • UE4源码版在xcode编译报错 Redefinition of Enumerator 解决方案
定位源码文件"Engine/Source/ThirdParty/libWebSockets/libwebsockets/include/Mac/libwebsockets.h"
搜索代码段:
enum http_status {
将其改为:
enum class http_status {
重新编译xcode解决问题。
参考链接:https://forums.unrealengine.com/t/redefinition-of-enumerator-building-ue4-27-from-source-with-xcode-on-m1-macbook/618542/2

  • UE4源码版在xcode编译报错 ordered comparision of function pointers xxx [-Werror,-Wordered-compare-function-pointers] 解决方案
chatGPT回答:这个错误是因为在比较两个函数指针时,编译器不确定它们的顺序。要解决这个错误,可以将编译选项中的-Werror,-Wordered-compare-function-pointers移除,这样编译器就不会将这个错误视为严格的错误,而只是一个警告。具体的做法是在执行编译命令时,去掉-Wordered-compare-function-pointers选项。
定位老位置"\Engine\Source\Programs\UnrealBuildTool\Platform\Mac\MacToolChain.cs"添加代码:
Result += " -Wno-ordered-compare-function-pointers";
使用Rider重新编译UnrealBuildTool
Engine/Source/Programs/UnrealBuildTool/UnrealBuildTool.csproj

  • UE4项目在xcode编译报错 Cannot code sign because the target does not have an Info.plist file and one is not being generated automatically...... 解决方案
在Build Settings中找到Packing分栏的Generate Info.plist File 把值改为Yes即可。
<hr/>分享最近在B站看到的优秀视频:
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-4-29 22:42 , Processed in 0.104480 second(s), 27 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表