Quick answer: The shader variant the AssetBundle needs was stripped because no scene in the player referenced it. Add the shader to Always Included Shaders and ship a ShaderVariantCollection capturing the variants. Warm it at app startup.
Here is how to fix Unity AssetBundles whose materials render solid pink (Unity’s missing-shader fallback) on mobile while looking fine in the editor. The shader exists in the bundle. The material reference is correct. But the variant the material needs was stripped from the player build because no scene at build time used that exact combination of keywords. Mobile builds are aggressive about stripping; AssetBundles bear the brunt.
The Symptom
You ship a base APK / IPA and download AssetBundles for content. In editor, everything renders correctly. On device, AssetBundle assets render solid pink/magenta. Console may log Could not find compatible shader variant.
What Causes This
Variant stripping. The build pipeline scans scenes and includes only variants used. If a material in an AssetBundle uses a unique keyword combination not seen in any scene, that variant is stripped from the player.
Shader not in Always Included. Shaders only used at runtime via AssetBundles can be stripped entirely if no scene references them.
Different graphics tier. Some shaders compile differently per tier (Mobile, Low, Medium, High). Editor uses high tier; mobile uses Tier 1. Variants for Tier 1 may not exist in your build.
Keyword collisions. Materials in AssetBundles may set custom keywords your in-scene materials never set. Those keyword permutations are not captured by build-time scanning.
The Fix
Step 1: Add shaders to Always Included Shaders. Open Project Settings → Graphics → Always Included Shaders. Click + and add every shader your AssetBundles reference. This guarantees the shader binary ships, even if no scene uses it.
Step 2: Build a ShaderVariantCollection. Open Project Settings → Graphics → Shader Loading. Enable Log Shader Compilation and Save to Asset. Run through every scene and AssetBundle preview in the editor. Unity records every variant used. Export as ShaderVariantCollection (.shadervariants).
Step 3: Ship and warm the SVC.
using UnityEngine;
public class VariantWarmer : MonoBehaviour
{
[SerializeField] private ShaderVariantCollection variants;
void Awake()
{
if (variants != null && !variants.isWarmedUp)
{
variants.WarmUp();
DontDestroyOnLoad(gameObject);
}
}
}
Drop this on a bootstrap object. WarmUp may take a few hundred milliseconds; show a loading splash if needed.
Step 4: Build AssetBundles for the same target as the player.
// Editor build script
BuildPipeline.BuildAssetBundles(
outputPath,
BuildAssetBundleOptions.None,
BuildTarget.Android); // match player platform
An AssetBundle built for one platform with one graphics API may not work on another. Always build per platform.
Step 5: Disable Strict Variant Stripping during diagnosis. In Project Settings → Graphics → Shader Loading → Strip From Build, set to None temporarily. Build. If the AssetBundle now renders correctly, stripping was the cause — turn back on with the SVC in place.
URP/HDRP Shader Stripping Settings
SRPs have additional stripping in their respective asset settings. Open the URP Asset and check options like Strip Unused Variants. Disable per-quality-level toggles if you ship a single quality. For HDRP, Project Settings → HDRP Asset → Shader Stripping.
Verifying On Device
Run with UNITY_LOG_SHADER_COMPILATION:
# Build with Development Build + Script Debugging on
# Run on device, capture logcat (Android) or Console.app (iOS)
# Look for "Compiling shader variant" or "Failed to find compatible shader variant"
The latter pinpoints exactly which variant is missing.
“Always Included Shaders + ShaderVariantCollection + warm at startup. The triple that keeps AssetBundle pink at bay.”
Related Issues
For URP-specific shader build issues, see URP Shader Not Rendering. For variant collection issues, see Variant Collection Missing.
Always Include the shaders. Capture the variants. Warm at startup. The pink goes away.