Errors in displaying Star rating

i can display my score stars in unity properly

As show above but in actual Android device it isnt showing

where have i gone wrong cant seem to figure it out.
here is score script:-

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class score1 : MonoBehaviour
{
    public static score1 instance;
    private Text scoreText;
    private int scr;
    public GameObject[] stars;


    void Start()
    {
       PlayerPrefs.SetInt("Score", score1.instance.GetScore());
        StartCoroutine(StartStar());
    }
    // Start is called before the first frame update
    void Awake()
    {
        scoreText = GameObject.Find("scores").GetComponent<Text>();
        MakeInstance();
    }

    // Update is called once per frame
    void MakeInstance()
    {
        if (instance == null)
            instance = this;
    }
    public void IncrementScore()
    {
        scr++;
        scoreText.text = "Score:" + scr;
        StartCoroutine(ShowStarrCo());

    }
    public int GetScore()
    {
        return this.scr;
       
    }
    IEnumerator ShowStarrCo()
    {
       
        if (scr < 3)
        {
            stars[0].SetActive(false);

            stars[1].SetActive(false);

            stars[2].SetActive(false);
            yield return new WaitForSeconds(0);

        }
        else if (scr < 7)
        {
            stars[0].SetActive(true);
           
            stars[1].SetActive(false);
            stars[2].SetActive(false);

        }
        else if (scr < 15)
        {
            stars[0].SetActive(true);
            yield return new WaitForSeconds(1);
            stars[1].SetActive(true);
            stars[2].SetActive(false);
            yield return new WaitForSeconds(0);
        }
        else
        {
            stars[0].SetActive(true);
            yield return new WaitForSeconds(1);
            stars[1].SetActive(true);
            yield return new WaitForSeconds(1);
            stars[2].SetActive(true);
        }

    }
    IEnumerator StartStar()
    {
        if (scr == 0)
        {
            stars[0].SetActive(false);

            stars[1].SetActive(false);

            stars[2].SetActive(false);
            yield return new WaitForSeconds(0);

        }
    }

Hello @manan966 ,
Instead of pointing out the line causing the issue, I think it is more useful to tell you how I (and other developers) usually attack these issues.

In most coding IDEs (Visual Code, Visual Studio, Rider, etc) you can attach your IDE to Unity. This allows you to place break points on the different lines in your code. Once a break point is “hit”, you can inspect all the values that are currently loaded in memory. You can then move forward, one line at a time (step) to trace where and how your program does something unexpected.

Take a look at this link on how you can setup your IDE and place your first break point: https://docs.unity3d.com/Manual/ManagedCodeDebugging.html

Once you have done this, let us know how it went!

Happy developing!

I did as told, and the script is working just fine and still the same problem persist that stars show at unity editor when i play and get required score but it isnt working in my android device

So at the end of the documentation I shared, it also goes into how you can debug on your android device. Give that a go as well and see if you can find the issue.

I tried everything cant seem to know nothing is wrong with scripts but the stars arent loaded in android device dont know why