Android sprite shaders missing (pink) change via code

Hey,
I was working with unity’s sprite/diffuse shaders and they work just fine in the editor. But when I make them in android standalone and test them in my Samsung Note 2 they appear pink, which is I reckon missing textures or unsupported shaders.
I am changing it from a supported texture using this code

void Awake()
	{
		daynm = GameObject.Find ("DNM");
		if (daynm.GetComponent<DayNightManager> ().isNight == true) {
			gameObject.renderer.material.shader = Shader.Find("Sprites/Diffuse");	
		}
	}

If you’re changing shaders during runtime, you need to make sure that they’re being included in the build (Go to Edit → Project Settings → Graphics → Always Included Shaders and make sure that Sprites/Diffuse is listed there).

The only shaders that Unity can resolve and include at compile-time are those that are initially assigned to objects.

Alright, I found a foolproof fix. Create a folder called Resources in your Assets. Now make a new shader. Copy the code of your shader in it, change the name as of your new shader in the code (it’s in first few lines you can’t miss it). Save it.

Now in the the code, call for the shader as normal. It should work fine.

             gameObject.renderer.material.shader = Shader.Find("MyShader");