Search Unity

Identifier uniqueness violation for Sprites

Discussion in 'Editor & General Support' started by Aurigan, Jun 23, 2022.

  1. Aurigan

    Aurigan

    Joined:
    Jun 30, 2013
    Posts:
    291
    I'm seeing this warning for a few sprites in my project. These are png files that were imported from an asset store package then duplicated to make several versions of the same asset.

    Code (CSharp):
    1. Identifier uniqueness violation: 'InternalId: -222513487695332513'. Multiple Sprites with the same internal Id are stored in this importer. There is no guarantee that subsequent imports of this asset will properly re-link to these targets.
    Two questions:

    How do I fix this warning?

    I don't actually want these files to be linked in any way to the original asset store versions. Is there a way to manually break that connection?

    Thanks!
     
  2. Aurigan

    Aurigan

    Joined:
    Jun 30, 2013
    Posts:
    291
    Bump ... vexing to have a warning get spammed without any hint how to solve it.
     
  3. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    602
    Did you tried deleting the .meta files next to pngs? Most of the Unity specific information about imported assets is typically stored in files next to the original with .meta extension.

    After deleting .meta files you will to reconfigure the import settings and reslice them (if you have multiple sprites in a single image). You will also have to update any scene or prefab referencing them since at that point they will be considered new assets. So do this only for problematic assets.
     
  4. Aurigan

    Aurigan

    Joined:
    Jun 30, 2013
    Posts:
    291
    I haven't ... the pngs that appear to be causing issues are sliced, used for animation - they contain multiple monster heads/legs/body parts/etc. Deleting the meta files and recreating the exact slicing/pivots etc. would be significant work.

    There also doesn't seem to be any way to work out exactly what files need to be changed/re-done/fixed ... if I search my project for "internalID: -222513487695332513" I see 17 instances of that string, 17 different files, but Unity is only throwing 6 warnings.

    ... so I fixed it manually by going through every file and deleting/correcting the IDs.