The error you're encountering, Shader Spine/Skeleton, subshader 0, pass 1, stage all: variant <no keywords> not found.
, is related to shader variants and keywords in Unity. This issue can arise due to several reasons, including shader stripping, incorrect shader usage, or missing shader variants.
Here are some steps to help resolve the issue:
Shader Keywords and Variants: Unity uses shader keywords to create different variants of a shader. If a required variant is stripped out during the build process, it can lead to errors like the one you're seeing. Ensure that the necessary shader variants are included in your build. You can do this by:
- Disabling shader variant stripping in the project settings (not recommended for production).
- Creating dummy materials that reference the required shader variants and including them in your build.
- Changing
shader_feature
tomulti_compile
in your shader code to ensure all variants are included.
Shader Usage: Make sure you are using the correct shader for your Spine assets. For example, if you are using
SkeletonGraphic
components, you should use theSkeletonGraphic
shaders provided by Spine.Updating Spine-Unity Runtime: Ensure you are using the latest version of the spine-unity runtime. Older versions might have bugs or missing features that could cause such issues. You can download the latest version from the Spine Unity Download page.
Shader Fallbacks: Temporarily disable shader fallbacks to diagnose the issue. Replace lines like
Fallback "another/shader name"
withFallback Off
in your shader code. This will make it easier to identify if a shader can't be loaded.Asset Bundles and References: Ensure that the shaders and materials are correctly referenced and included in your asset bundles. Mismatched references or missing updates can cause such issues.
Testing in a Clean Project: Sometimes, issues can be caused by project-specific settings or conflicts. Test your Spine assets in a clean Unity project with only the spine-unity runtime to see if the issue persists.
Here is a useful link for more information on writing your own shaders for spine-unity: Writing your own shaders.
By following these steps, you should be able to diagnose and resolve the shader variant error on your Android device.