[4.9.1] Many editor-only assets are packaged on iOS builds

After migrating from 4.5.1 to 4.9.1, our IPA size increased by a lot. Investigating the contents reveal several editor-only assets were included inside the IPA, like engine debug materials, tutorials, icons, meshes, sounds and fonts. I did some digging and found different causes behind this:

  • Editor assets being listed as startup packages on BaseEngine.ini, which causes them to be always referenced even in shipping builds (there’s a comment about “console platforms removing debug materials”, but no indication of how this should be done).

  • FAssetReference variables which contain assets used only while in the editor but are not wrapped with #if WITH_EDITOR tags (example: PreviewShadowsIndicatorMaterialName).

  • Assets referenced in *Editor INI files being cooked in shipping builds for no reason (tutorials).

I found that it is possible to remove the start up packages in platform-specific configs by doing this:

[Engine.StartupPackages]
-Package=/Engine/EngineDebugMaterials/BoneWeightMaterial
-Package=/Engine/EngineDebugMaterials/DebugMeshMaterial
-Package=/Engine/EngineDebugMaterials/GeomMaterial
-Package=/Engine/EngineDebugMaterials/HeatmapGradient
-Package=/Engine/EngineDebugMaterials/LevelColorationLitMaterial
-Package=/Engine/EngineDebugMaterials/LevelColorationUnlitMaterial
-Package=/Engine/EngineDebugMaterials/MAT_LevelColorationLitLightmapUV
-Package=/Engine/EngineDebugMaterials/ShadedLevelColorationLitMaterial
-Package=/Engine/EngineDebugMaterials/ShadedLevelColorationUnlitMateri
-Package=/Engine/EngineDebugMaterials/TangentColorMap
-Package=/Engine/EngineDebugMaterials/VertexColorMaterial
-Package=/Engine/EngineDebugMaterials/VertexColorViewMode_AlphaAsColor
-Package=/Engine/EngineDebugMaterials/VertexColorViewMode_BlueOnly
-Package=/Engine/EngineDebugMaterials/VertexColorViewMode_ColorOnly
-Package=/Engine/EngineDebugMaterials/VertexColorViewMode_GreenOnly
-Package=/Engine/EngineDebugMaterials/VertexColorViewMode_RedOnly
-Package=/Engine/EngineDebugMaterials/WireframeMaterial

But it doesn’t feel future proof enough.

Hey

Over the versions, the size of the packages do increase and that’s due to the upgrades made on the editor. If you wish to remove the editor-only assets that are packaged within your build, feel free to remove them. If you run into any errors while doing this, please upload the full and we will be more than happy to investigate the issue further for you.

With that being said, iOS packages are larger than they used to be and it seems to be due to needing to disable dynamic point lighting by setting the number of point lights to support 0 within the project settings. However we have 2 tickets in for the iOS package sizes: UEMOB-45 and UEMOB-46.

Thanks!

Removing many of those assets via brute force doesn’t seem very practical, because I assume the editor will become unusable, unless I keep a 2nd copy of the editor around and build solely through command line. These are assets that are never, ever, referenced in shipping builds for any platform: editor visualization materials, editor tutorials, editor debug assets. There’s 24MBs worth of engine debug materials, for example. Even the material used by the editor gizmo and the grid are there.

Also, my attempt at disable specific startup packages failed. It seems platform-specific config files are only used during runtime, not packaging, so I would need to disable those packages at the editor-level, which again would break the editor.

Hey

Here is another suggestion for you: Have you attempted to go into your ‘Project Settings’ and under the ‘Packaging’ section, editing the options for what is or is not included in your project?

Thanks!

hi~Do you have any solution to remove the engine resource in the ipa?