SRMR
SRMR

Reputation: 3134

App Icon has Unassigned Image error

I'm getting these errors:

enter image description here

I can't tell exactly which thing it is talking about?

enter image description here

If it is a 42 mm 2x, then I don't have a spot to put that. Can you help? Thanks!

enter image description here

EDIT: Per comment below, I looked on the right pane. Looks like it needs the 44 2x...

enter image description here

enter image description here

...so I have one created, but the Unassigned doesn't highlight when I drag the icon over it, so how do I assign it in my image assets?

enter image description here

EDIT again: Right click show in finder? enter image description here

Upvotes: 34

Views: 26068

Answers (7)

lazarevzubov
lazarevzubov

Reputation: 2285

In my case I accidentally removed some assets and then returned them by means of git (just reverted deleted files from Xcode's Source Control tool) – the image files came back, but the asset didn't work and I had the same warning.

I opened the Contents.json file in the asset directory and saw that the images array was empty. I added my images there manually. For example:

{
  "images" : [
      {
        "idiom" : "universal",
        "filename" : "Icon.png",
        "scale" : "1x"
      },
      {
        "idiom" : "universal",
        "filename" : "[email protected]",
        "scale" : "2x"
      },
      {
        "idiom" : "universal",
        "filename" : "[email protected]",
        "scale" : "3x"
      }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}

Upvotes: 0

Doan Bui
Doan Bui

Reputation: 4418

My case is: My Macbook is running out of memory, so every time I restart the computer. I don't understand how the icloud driver erased or replaced all the data in the Contents.json file in the folder:

Runner> Assets.xcassets> AppIcon.appiconset (I dev with Flutter).

So the solution for my case is I have to bring the Contents.json file back from the back up and it works normally.

Upvotes: 0

TreeAndLeaf
TreeAndLeaf

Reputation: 1273

I had old icon files (no longer needed) in the folder where contents.json is located. I removed those files in Finder and the issue was solved.

Upvotes: 1

Nate
Nate

Reputation: 13242

I had to

  • right click on one of the images in the lower row (with "unassigned" written under the row)
  • select "Universal" to unselect it
  • right click and
  • "Universal" again to select it
    • This changed the top row to show 3 empty boxes that were empty
  • Drag each of the images from the unassigned row to the universal row

Though, I don't know why those menu options are disabled in the original question...

Upvotes: 2

esvau
esvau

Reputation: 744

I had the same issue! The solution that worked for me was pretty easy:

Just select the unassigned image and delete it via delete button. Clean and Build. Done.

Hope this helps!

Upvotes: 69

Idan
Idan

Reputation: 9940

Remove all "unassigned" photos from the asset catalog. It shouldn't appear there (click "Remove Selected Items" on your screenshot).

Upvotes: 1

Darkseal
Darkseal

Reputation: 9564

(That's assuming you didn't miss any of the required images)

I had this problem a while ago: I went into the media.xcassets directory and checked the contents.json file, where I found some entry with "unassigned" set to TRUE. I removed it and it removed the compiler warning.

Hope you got stuck in that same scenario so you will also be able to fix it.

Upvotes: 4

Related Questions