All pink UI materials on Android

Hi all,

Builds I am now making to Android phone are having an issue with all UI appearing pink as if the shader/material is missing or incompatible.

I have installed an asset called Sprite Shaders Ultimate recently which seems like a fantastic asset. On testing it out I accidently clicked the change to Linear workspace which then did a full reimport of everything and maybe other things. I have reverted back to gamma since. It may well not be anything to do with the asset, but just a big change I have made since this has started happening.

Things I have tried to fix the issue -

Reset Graphics shaders to make sure it includes UI/Default.
Set Auto graphics API to true under Player

One thing I have noticed is the default fallback material for UI is ‘Default UI Material’
I however cannot see this material if I go to 3 dots and select material. This does nothing.
I have never actually tried this in the past with Unity built materials so I am not sure if they hide them.

If anyone has any other ideas of things I could try to resolve this that would be amazing!

Cheers

Before you take too much of a wrecking ball through your project, you may wish to see what the issue is by studying the adb logcat output from your Android device. :slight_smile:

From that intel you might find actionable information and move up the value chain from just blindly trying combinations and hoping for the best.

By debugging you can find out exactly what your program is doing so you can fix it.

Use the above techniques to get the information you need in order to reason about what the problem is.

You can also use Debug.Log(...); statements to find out if any of your code is even running. Don’t assume it is.

Once you understand what the problem is, you may begin to reason about a solution to the problem.

Remember with Unity the code is only a tiny fraction of the problem space. Everything asset- and scene- wise must also be set up correctly to match the associated code and its assumptions.

Hi Kurt,

In the logcat there is only 1 thing that stands out to me as a warning -

‘Unity Material Default UI Material doesn’t have _Stencil property’

This message appears a heck bunch of times (maybe the amount of the UI elements missing)

However I have googled this and cannot find out why this has a warning. This material does have a stencil property as I understand Unity needs them for draw calls.

This error is UI wide only, and does not effect inside the editor, only on build.

Cheers

Further onto that, everytime I open a window with new image elements, that _Stencil message appears.

The thing is I havent changed the default UI material, or not knowingly anyway.
Does anyone know how to fix this error?

‘Unity Material Default UI Material doesn’t have _Stencil property’