Android build faliure - Shader issue/OpenGL?

Hi all,

I have a playable build of my game, I manage an export for MacOS, but in no way a build for Android.

I am working on a MacbookPro m2Max, Unreal Engine 5.2.1

I had big problems with setting up SDK but I managed to fix that. Now the build compiles, but I get this error at the end and I don’t know how to solve it.

I have searched forums and youtube and I don’t know what else to try. If anyone can help me it would be great.

Thank you,
Gasper

Hi @gasperjager ,

So this is a crash of OpenGL Shader Compiler at this line:
Engine/Source/Developer/ShaderFormatOpenGL/Private/OpenGLShaderCompiler.cpp#L1759

Is there anything in the log that says which Shader is being compiled when this crash happens?
Have you checked the log file mentioned by UATHelper?

MacOS/IOS uses RHI called Metal, while Android uses OpenGL.
That’s why you’re not experiencing any issues on your Macbook but during Android cook you do.

There were some patches to the OpenGLShaderCompiler since 5.2.1 but none of them seems related to that exact line (I might be wrong though).
Hard to tell what’s going on without more info like Callstack Trace or whole log file.

Perhaps, one of your shaders (Materials) is corrupted or uses faulty instruction.
If you could narrow down which one is it, that would be easy to fix by removing it or by changing the shader a bit.

Cheers!

Hey @dzemzmcdonalda thanks for the answer. I tried finding out what exactly is the problem but honestly i’m a bit lost. I found the log.txt file…if you by chance know what to look for please help me.
Log.txt (810.6 KB)

Thanks, Gasper

Hey @gasperjager,

Log says:

LogTexture: Display: Building textures: /Game/Arena/Textures/T_Ornaments02_MSK.T_Ornaments02_MSK (ASTC_RGBAuto, 4096x4096 x1x1x1) (Required Memory Estimate: 500.210641 MB), EncodeSpeed: Final
2024-05-12 23:23:54.043 UnrealEditor[60343:3920498] [UE] Assertion failed: TextureIndices [File:./Developer/ShaderFormatOpenGL/Private/OpenGLShaderCompiler.cpp] [Line: 1712]

which means that it crashes while compiling Texture T_Ornaments02

Perhaps T_Ornaments02 is corrupted. Try to remove any asset which uses said Texture from your Game and see if you can cook it further.

If this will help, then it was just a corrupted asset. If it won’t help the issue might be somewhere else. We will see.


Log also mentions bunch of other issues, e.g:

LogMaterial: Warning: [AssetLog] /Users/gasperjager/Documents/Unreal Projects/RampageGames/Content/Bazaar_Meshingun/Master_Material/Water_Meshingun/Material/MM_Water.uasset: Failed to compile Material for platform GLSL_ES3_1_ANDROID, Default Material will be used in game.
	Function MF_FakeRefraction: (Node SceneColor) Node not supported in feature level ES3_1. SM5 required.
	Function MF_FakeRefraction: (Node MakeMaterialAttributes) Error on property BaseColor

Basically, a lot of shaders fails to compile and you will NOT be able to see them in the final build.
Android is a pretty limiting platform so this is probably expected.
If you haven’t build your game with Android in mind, you may won’t be able to easily solve this.


You mentioned:

so there might be something wrong with your SDK setup.
If removing the texture won’t help, SDK might be a cause of the issue.