I have an ammo counter setup in my scene that shows the fill ratio for each weapon and cycles through the different UI icons when player changes weapons, and it works fine in the editor but when i built my project only the UI icon for the primary weapon is visible but when the player changes weapons the icon disappears.
Primary Weapon with visible UI icon on the bottom left corner:
When it works in editor, then it’s maybe a problem with the screen resolution.
Think you can test, if the problem already appears when you change the screen dimensions in the game-view.
And then you should maybe check if both images (in the assets) have same dimensions (pixel-size, aspect-ratio, filetype) and same import settings.
Also maybe check if you are anchoring your images in the UI or if you have set any hard-coded pixel-values (for left, right, top or bottom). That could also maybe make the image disappear in worst-case for some screen-resolutions.
Do you also just exchange the sprite of the same image component or do you use extra GameObjects for each icon? In second case, also ensure, that RectTransform of all GameObjects has same settings.