Custom shader works in editor, displays in all pink on Android. Fragment shader shows in logcat

Here’s the shader I wrote:

    Shader "Custom/InstancedContourShader"
    {
       Properties
       {
           _Color ("Color", Color) = (1,1,1,1)
           _LineWidthInverse ("LineWidthInverse", Float) = 0.98
           _MainTex ("Texture", 2D) = "white" {}
       }
       SubShader
       {
            Tags {"RenderType"="Opaque" "LightMode"="ForwardBase"}
           LOD 100
  
           Pass
           {
               CGPROGRAM
           #pragma debug
               #pragma vertex vert
               #pragma fragment frag
                #pragma multi_compile_instancing
  
               #include "UnityCG.cginc"
                #include "UnityLightingCommon.cginc"
  
                struct appdata
                {
                    float4 vertex : POSITION;
                    float4 normal : NORMAL;
                    float2 texcoord: TEXCOORD;
                    UNITY_VERTEX_INPUT_INSTANCE_ID
                };
  
               struct v2f
               {
                   float2 uv : TEXCOORD0;
                    fixed4 diff : COLOR0;
                   float4 vertex : SV_POSITION;
                    UNITY_VERTEX_INPUT_INSTANCE_ID
               };
  
               sampler2D _MainTex;
               float4 _MainTex_ST;
              
               // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
               // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
               #pragma instancing_options assumeuniformscaling
               UNITY_INSTANCING_CBUFFER_START(Props)
                   UNITY_DEFINE_INSTANCED_PROP(fixed4, _Color)
                   UNITY_DEFINE_INSTANCED_PROP(float1, _LineWidthInverse)
       //           fixed4 _Color;
               UNITY_INSTANCING_CBUFFER_END
  
                v2f vert (appdata v)
                {
                    v2f o;
                    UNITY_SETUP_INSTANCE_ID(v);
                    UNITY_TRANSFER_INSTANCE_ID(v, o); // necessary only if you want to access instanced properties in the fragment Shader.
                    o.vertex = UnityObjectToClipPos(v.vertex);
                    o.uv = v.texcoord;
                    half3 worldNormal = UnityObjectToWorldNormal(v.normal);
                    half nl = abs(dot(worldNormal, _WorldSpaceLightPos0.xyz));
                    o.diff = nl * _LightColor0;
  
                    // the only difference from previous shader:
                    // in addition to the diffuse lighting from the main light,
                    // add illumination from ambient or light probes
                    // ShadeSH9 function from UnityCG.cginc evaluates it,
                    // using world space normal
                    o.diff.rgb += ShadeSH9(half4(worldNormal,1));
                    return o;
                }
  
               fixed4 frag (v2f i) : SV_Target
               {
                    UNITY_SETUP_INSTANCE_ID(i); // necessary only if any instanced properties are going to be accessed in the fragment Shader.
                   // sample the texture
                   fixed4 col = tex2D (_MainTex, i.uv) * UNITY_ACCESS_INSTANCED_PROP(_Color);
                    col *= i.diff;
                   float t = max (abs(i.uv.x), abs(i.uv.y));
                   t = min(t - UNITY_ACCESS_INSTANCED_PROP(_LineWidthInverse), 0);
                   t = -sign(t);
                   col *= t;
                   return col;
               }
               ENDCG
           }
       }
    }

The shader is used in several materials, all are directly attached to gameobjects. I tried applying fixes suggested for similar questions like adding the shader to always include in the project settings and disabling stripping for instanced variants. But to no avail.

Here’s the adb logcat output regarding shaders:

Since the compiled fragment shader part is output several times (once for each material I’m guessing) there should be a problem with the fragment shader specifically but it doesn’t tell me what the problem is.

It’s a Gear VR app running on an S7.

Running into the same problem. The shader is loaded, so “Make sure it’s loading” isn’t a solution.

This means the shader failed to compile or link on the device.
Can you provide device logs (from a development build)? The exact error should be shown there.