Crash during deploy to iOS

Hi all,

Thanks so much for reading.

Environment: Build - MacBook Pro Arm CPU / Deploy - iPhone 11 Pro Max.
Unreal Engine: 5.5.1, PaperZD, Paper2D.

I’m trying to get a game to run on iPhone but the cooking process causes a crash in the build. I did actually have it working at one point, and it ran on the phone just fine.

But in the course of trying to create some buttons to handle jump and attack on iOS which has no keyboard I messed around with the platform settings and I think somehow the textures were changed.

See here for the full logs as a Github gist.

Part log from cook.txt showing the crash:

LogMaterial: Display: Missing cached shadermap for DataflowVertexMaterial in METAL, Default, ES3_1, Game (DDC key hash: e1fcd05230eb72ae2f3da53ed2883bcbefc72d3c), compiling. 
LogMaterial: Display: Missing cached shadermap for BasicShapeMaterial in METAL, Default, ES3_1, Game (DDC key hash: 16fbc6ffadae32d225e54422cf37d45e46634cc9), compiling. 
LogMac: === Critical error: ===
SIGSEGV: invalid attempt to access memory at address 0x0

LogMac: 0x0b699348 UnrealEditor-TextureBuildUtilities.dylib!UE::TextureBuildUtilities::GetOutputPixelFormatWithFallback(FTextureBuildSettings const&, bool)   [UnknownFile]) 
0x1ae952d4 UnrealEditor-Engine.dylib!FinalizeBuildSettingsForLayer(UTexture const&, int, ITargetPlatform const*, ETextureEncodeSpeed, FTextureBuildSettings&, FTexturePlatformData::FTextureEncodeResultMetadata*)   [UnknownFile]) 
0x1ae921a4 UnrealEditor-Engine.dylib!GetBuildSettingsPerFormat(UTexture const&, FTextureBuildSettings const&, FTexturePlatformData::FTextureEncodeResultMetadata const*, ITargetPlatform const*, ETextureEncodeSpeed, TArray<TArray<FTextureBuildSettings, TSizedDefaultAllocator<32>>, TSizedDefaultAllocator<32>>&, TArray<TArray<FTexturePlatformData::FTextureEncodeResultMetadata, TSizedDefaultAllocator<32>>, TSizedDefaultAllocator<32>>*)   [UnknownFile]) 

Part log from log.txt pointing to the above:

LogMaterial: Display: Missing cached shadermap for DataflowVertexMaterial in METAL, Default, ES3_1, Game (DDC key hash: e1fcd05230eb72ae2f3da53ed2883bcbefc72d3c), compiling.
LogMaterial: Display: Missing cached shadermap for BasicShapeMaterial in METAL, Default, ES3_1, Game (DDC key hash: 16fbc6ffadae32d225e54422cf37d45e46634cc9), compiling.
LogAnalytics: Display: [CrashReporter.Release] APIServer = https://datarouter.ol.epicgames.com/datarouter/api/v1/public/data. AppVersion = ++UE5+Release-5.5-CL-40574608
CrashReportCoreLog: Display: Applying project settings from '/Users/sez/Library/Application Support/Epic/UnrealEngine/5.5/Saved/Crashes/CrashReport-UE-CrustyPirate-pid-90887-16C521EFF84098BDD11C388936A17ADB/CrashReportClient.ini'.
LogAnalytics: Display: [CrashReporter.Release] Destroying ET Analytics provider
LogAnalytics: Display: [CrashReporter.Release] Ended ET Analytics provider session
LogAnalytics: Display: [CrashReporter.Release] Destroyed ET Analytics provider
Took 22.66s to run UnrealEditor, ExitCode=1
SafeDeleteFile /Users/sez/Library/Logs/Unreal Engine/LocalBuildLogs/Cook-2025.05.20-16.51.39.txt
SafeCopyFile /Users/Shared/Epic Games/UE_5.5/Engine/Programs/AutomationTool/Saved/Cook-2025.05.20-16.51.16.txt /Users/sez/Library/Logs/Unreal Engine/LocalBuildLogs/Cook-2025.05.20-16.51.39.txt
SafeDeleteFile /Users/Shared/Epic Games/UE_5.5/Engine/Programs/AutomationTool/Saved/Cook-2025.05.20-16.51.16.txt
==============================================================================
Cook failed.
(see /Users/sez/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)

CommandletException: Editor terminated with exit code 1 while running Cook for /Users/sez/depot/UnrealEngine2D/CrustyPirateGame/CrustyPirate.uproject; see log /Users/sez/Library/Logs/Unreal Engine/LocalBuildLogs/Cook-2025.05.20-16.51.39.txt
   at AutomationTool.CommandUtils.FinishRunCommandlet(FileReference ProjectFile, String Commandlet, DateTime StartTime, IProcessResult RunResult, String LocalLogFile, String& DestLogFile, UInt32 ErrorLevel) in /Users/build/Build/++UE5/Sync/Engine/Saved/CsTools/Engine/Source/Programs/AutomationTool/AutomationUtils/CommandletUtils.cs:line 477

The source code and project is here, on my public Github - CrustyPirateGame

hi @sarah_j_smith , what mobile shading are you using? forward shading or deferred shading?

Hi @tootzoe1 - its Forward Shading.

I can reproduce the same exact error by just choosing “Cook” from the “Platforms” menu.

At the moment my best guess is that somehow the builds messed up the assets during an automatic re-import.

I know at one point that I did have Windows turned on as a platform, and an error message that occurred on a previous build led me to a post that said SM5 vs SM6 and Direct X / Windows was an bad combination.

Ugh.

I am thinking I will just have to roll everything back to a known good version in Git and see if I can reconstruct from there.

OK, I never got to the bottom of this.

I had to revert my changes and start again, from a known good point.

But its working now.

hi , @sarah_j_smith
i was able to run on macos , win11 , android platforms, I am also interesting with making it runs on iOS, my macbook is old and slow , maybe i can package it for iOS for testing tonight…

After I made some settings below, I was able to package and run the game on my phone
( UE-5.6.0 )

Editor Preferences --> Privacy --> Bug Reports --> turn off
Project Settings --> iOS --> Metal Shader standar to Target == Metal v3.1
Project Settings --> iOS --> Minimum iOS Version == 17.0

and this is screen record on my phone:

1 Like

Oooo - nice work!! Thanks for persevering with this.