Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assets Warning - The image set name xxx is used by multiple image sets

Tags:

xcode

ios

Just curious, apologize in advance if bothered.

Getting the warning When i using same name for multiple image sets. I already know using different names will solve the problem. But i am wandering what is the behavior of Xcode what if i don't do that by still keeping two image sets with the same name and run project. Which image set will be chosen ?

EDIT

Here is Relevant docs .

like image 478
will wang Avatar asked Aug 26 '16 01:08

will wang


2 Answers

According to Apple Asset Catalog Format Reference docs:

For any target in an Xcode project, the fully qualified name of an asset must be unique across all the asset catalogs and across all asset types. For example, it is an error to have an image set folder in one asset catalog called Llama.imageset and an image set with the same name in the same catalog or in a different catalog that is part of the same target. Similarly, it is an error to have both an image set folder called Llama.imageset and an app icon folder called Llama.appiconset in the same catalog or in a different catalog that is part of the same target.

like image 160
gurmandeep Avatar answered Oct 03 '22 01:10

gurmandeep


I found this question while looking for a way to fix the issue:

The image set name xxx is used by multiple image sets

I know my post does not answer the question asked here but I wanted to leave this response here just in case someone else happens to find this post as I did while searching for a solution.

I was moving images from one project to another when this warning appeared. It was apparently due to having 2x & 3x sizes with the same name.

However, I had the exact same images in another project named in exactly the same way without seeing this warning.

X-code had already appended the file names in the finder directory by adding “-1” and “-2” to the name when I moved the images into the Assets folder.

While back inside of x-Code I had all images in the Assets folder with the same name.

Looking here,

Target>Build Phases>Copy Bundle Resources

The way the folder appeared after I deleted the file

I found there were Two items being copied

"Assets.xcassets" and "Preview Assets.xcassets

I deleted the “Preview Assets.xcassets” and the problem was resolved.

I hope this helps someone.

like image 22
Jim Bray Avatar answered Oct 03 '22 00:10

Jim Bray