Posted onEdited onInUnrealEngine
,
构建Views: Symbols count in article: 4.5kReading time ≈11 mins.
Error of Not Importing Provision
Other errors during compilation:
1 2 3 4 5 6 7 8 9 10 11
****** [6/11] Compile UE4Game IOS
Reading local file list from C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Saved\BuildGraph\Compile UnrealHeaderTool Mac\Tag-Compile UnrealHeaderTool Mac.xml Reading local file list from C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Saved\BuildGraph\Update Version Files\Tag-Update Version Files.xml Reading shared manifest from C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Saved\BuildGraph\Compile UnrealHeaderTool Mac\Manifest.xml Running: C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Binaries\DotNET\UnrealBuildTool.exe UE4Game IOS Development -NoUBTMakefiles -nobuilduht -precompile -allmodules -nolink -nodebuginfo -Manifest=C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Intermediate\Build\Manifest.xml -NoHotReload -log="C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Programs\AutomationTool\Saved\Logs\UBT-UE4Game-IOS-Development.txt" [Remote] Using remote server 'xx.xx.xx.xxx' on port 22 (user 'buildmachine') [Remote] Using private key at C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Build\NotForLicensees\SSHKeys\10.75.27.129\buildmachine\RemoteToolChainPrivate.key [Remote] Using base directory '/Users/buildmachine/UE4/Builds/lipengzha-PC2' ERROR: Unable to find mobile provision for UE4Game. See log for more information. Took 4.0300959s to run UnrealBuildTool.exe, ExitCode=6
This is because the provision was not configured during the engine compilation, and it needs to be set in Engine/Config/BaseEngine.ini.
Here you can only specify the name of the provision file. The code in UEBuildIOS.cs will look for it under the path C:\Users\lipengzha\AppData\Local\Apple Computer\MobileDevice\Provisioning Profiles.
This process can also be imported through the engine, which requires not just importing the provision but also importing the certificate (which can also be imported via iPhonePackager):
Reading local file list from C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Saved\BuildGraph\Compile UnrealHeaderTool Mac\Tag-Compile UnrealHeaderTool Mac.xml Reading local file list from C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Saved\BuildGraph\Update Version Files\Tag-Update Version Files.xml Reading shared manifest from C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Saved\BuildGraph\Compile UnrealHeaderTool Mac\Manifest.xml Running: C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Binaries\DotNET\UnrealBuildTool.exe UE4Game IOS Development -NoUBTMakefiles -nobuilduht -precompile -allmodules -nolink -nodebuginfo -Manifest=C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Intermediate\Build\Manifest.xml -NoHotReload -log="C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Programs\AutomationTool\Saved\Logs\UBT-UE4Game-IOS-Development.txt" [Remote] Using remote server '192.168.1.123' on port 22 (user 'buildmachine') [Remote] Using private key at C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Build\NotForLicensees\SSHKeys\192.168.1.123\buildmachine\RemoteToolChainPrivate.key [Remote] Using base directory '/Users/buildmachine/UE4/Builds/lipengzha-PC3' [Remote] Uploading C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Intermediate\Remote\UE4Game\IOS\Development\com.xxxxx.xxxx.xx_Development_SignProvision.mobileprovision [Remote] Exporting certificate for C:\Users\lipengzha\AppData\Local\Apple Computer\MobileDevice\Provisioning Profiles\com.xxxxx.xxxx.xx_Development_SignProvision.mobileprovision... Executing iPhonePackager ExportCertificate C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Source -provisionfile C:\Users\lipengzha\AppData\Local\Apple Computer\MobileDevice\Provisioning Profiles\com.xxxxx.xxxx.xx_Development_SignProvision.mobileprovision -outputcertificate C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Intermediate\Remote\UE4Game\IOS\Development\Certificate.p12 CWD: C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Binaries\DotNET\IOS Initial Dir: C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Source Env CWD: C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Binaries\DotNET\IOS BranchPath = lipengzha-PC3/C/BuildAgent/workspace/FGameEngine/Engine/Engine/Binaries --- GameBranchPath = lipengzha-PC3/C/BuildAgent/workspace/FGameEngine/Engine/Engine/Binaries ---------- Executing command 'ExportCertificate' '' ... Looking for a certificate that matches the application identifier '9TV4ZYSS4J.com.xxxxx.xxxx.xx' .. Provision entry SN '61B440405D86B84D' matched 0 installed certificate(s) .. Failed to find a valid certificate that was in date IPP ERROR: Failed to find a valid certificate ERROR: IphonePackager failed. Took 2.9281688s to run UnrealBuildTool.exe, ExitCode=6
After resolving the issues above, the BuildGraph process can be executed normally, exporting the binary engine compiled according to the engine code, and upon startup, it can be seen that packaging for Windows/Android/IOS is available.
## Error Troubleshooting
No certificate for team xxxx matching
This issue is likely caused by a mismatch between the configured certificate in the project and the one in the system (or a single mobileProvision corresponding to multiple certificates). After performing the following steps, a machine restart is needed for the changes to take effect.
If you encounter the following error message:
1
Code Signing Error: No certificate for team '9TV4ZYSS4J' matching 'iPhone Developer: Created via API (JDPXHYVWYZ)' found: Select a different signing certificate for CODE_SIGN_IDENTITY, a team that matches your selected certificate, or switch to automatic provisioning.
Solution:
Clean up the extra mobileprovision files in ~/Library/MobileDevice/Provisioning Profiles on Mac.
Clear any expired developer certificates in the Mac keychain.
Reimport the mobileprovision and certificates.
Note: The name of the imported mobileprovision file must match the MobileProvision specified in BaseEngine.ini.
Execute the codesign command directly on the machine’s bash to see if a password prompt appears. If it does, it indicates that the keychain is locked. Signing command:
This is due to the lack of permission to access the keychain when calling /usr/bin/codesign via ssh. You can use the following command to unlock in ssh:
During UE remote builds, you can run this command to unlock the keychain in the current ssh environment, allowing subsequent signing to execute normally. Modify the Engine\Build\BatchFiles\Mac\Build.sh file to include the following content before calling UBT for compilation:
if [ "$4" == "-buildscw" ] || [ "$5" == "-buildscw" ]; then echo Building ShaderCompileWorker... mono Engine/Binaries/DotNET/UnrealBuildTool.exe ShaderCompileWorker Mac Development fi echo unlock mac keychain... security unlock-keychain -p password login.keychain echo Running command : Engine/Binaries/DotNET/UnrealBuildTool.exe "$@" mono Engine/Binaries/DotNET/UnrealBuildTool.exe "$@"
ExitCode=$? if [ $ExitCode -eq 254 ] || [ $ExitCode -eq 255 ] || [ $ExitCode -eq 2 ]; then exit 0 else exit$ExitCode fi
As the Build.sh will be passed to Mac via RSync during compilation, the following log can be seen:
1 2 3 4 5 6 7 8 9 10 11
[Remote] Executing build Running bundled mono, version: Mono JIT compiler version 5.16.0.220 (2018-06/bb3ae37d71a Fri Nov 16 17:12:11 EST 2018) unlock mac keychain... Running command : Engine/Binaries/DotNET/UnrealBuildTool.exe UnrealHeaderTool Mac Development -SkipRulesCompile -XmlConfigCache=/Users/buildmachine/UE4/Builds/lipengzha-PC2/C/BuildAgent/workspace/FGameEngine/Engine/Engine/Intermediate/Build/XmlConfigCache.bin -precompile -allmodules -Log=/Users/buildmachine/UE4/Builds/lipengzha-PC2/C/BuildAgent/workspace/FGameEngine/Engine/Engine/Programs/AutomationTool/Saved/Logs/UBT-UnrealHeaderTool-Mac-Development_Remote.txt -Manifest=/Users/buildmachine/UE4/Builds/lipengzha-PC2/C/BuildAgent/workspace/FGameEngine/Engine/Engine/Intermediate/Remote/UnrealHeaderTool/Mac/Development/Manifest.xml Target is up to date Deploying UnrealHeaderTool Mac Development... Deploying now! Total execution time: 1.01 seconds [Remote] Downloading C:\BuildAgent\workspace\FGameEngine\Engine\Engine\Intermediate\Remote\UnrealHeaderTool\Mac\Development\Manifest.xml [Remote] Downloading build products receiving file list ... done
This way, the keychain will be unlocked with every build, avoiding signing errors caused by lack of access to codesign during ssh connection.
Note: It is also necessary to check whether the value of SigningCertificate in BaseEngine.ini has been specified.
Method Two
If the intermediate developer certificate from Apple in the system is expired, it will also lead to this issue. The solution is to import the new Apple developer root certificate:
Delete the Apple Worldwide Developer Relations Certification Authority from the keychain, and then re-download and import a new one from the link above.
Method Three
Check in the keychain if the certificate was imported under Login or System. If it is in Login, delete it and re-import it to System.
Invalid trust settings
If you see the following error in the log:
1 2
Code Signing Error: Invalid trust settings. Restore system default trust settings for certificate "iPhone Developer: Created via API (JDPXHYVWYZ)" in order to sign code with it. Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 13.6'
This is due to a change in trust settings for the certificate in the Mac keychain. Change it back to Use System Defaults to resolve the issue.
unable to build chain to self-signed root for signer
Check if the certificate is imported under Login or System in the keychain. If it is in Login, delete it, and re-import it into System.
Copying Custom Directories
When building the binary engine, by default it is consistent with the installation from EpicLauncher, but if you modify the engine and want to package some new directories, modify the InstalledEngineFilters.xml file by adding directories under CopyEditorFilter:
<!-- Define Editor Filters --> <PropertyName="CopyEditorFilter"> <!-- This assembly is normally embedded into the UBT executable, but it can technically be rebuilt from an installed build --> Engine/Binaries/ThirdParty/Newtonsoft/... Engine/Binaries/ThirdParty/VisualStudio/...
To avoid recompiling the Engine module every time, which can lead to a large number of dependent modules in the engine being recompiled, modify the Engine.Build.cs:
The GameConfigurations was only set to Development, which means the compiled engine can only package Development. If you want to support Shipping packaging, you need to specify in BuildGraph: -set:GameConfigurations=Development;Shipping, but this will increase the build time since both Development and Shipping need to be compiled separately, adding some additional compilation time overhead across all supported platforms. However, this is necessary and can be selectively turned on during daily development to save build time.
The article is finished. If you have any questions, please comment and communicate.