Xamarin warning: The app icon set "AppIcons" has 2 unassigned children
Asked Answered
C

8

9

I'm getting the following warning when compiling:

Warnings:

/Users/some-user/Projects/SomeApp/SomeApp/SomeApp.csproj (Build) -> /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets (_CoreCompileImageAssets target) ->

Resources/Images.xcassets: actool warning : The app icon set "AppIcons" has 2 unassigned children.

1 Warning(s)

I have provided each image for the app icons (except watch/car). There is no "unassigned" value in the Contents.json file. I also tried to unset every image and set it again. I'm still getting the warning.

Currently I'm using Xamarin Studio 5.9.7 (build 22), Xamarin.iOS 9.0.1.29 with Mono 4.0.4., Xcode 7.0.1 (8228) Build 7A1001. All this runs on Mac OS X 10.10.5.

How do I get the warning removed?

Cyano answered 4/11, 2015 at 14:35 Comment(5)
Maybe try to add the images for the watch/car? Also does the warning affect the performance of your app in any way? If not I would suggest simply ignoring it.Photozincography
Tried to set all images without success. If you remove some the number of unassigned childs increases, but it is at least 2. No, performance seems not to be affected, but the warning is annoying...Cyano
An update to iOS 9.1 didn't changed something.Cyano
It's not Xamarin related. See https://mcmap.net/q/677749/-app-icon-unassigned-image-compilation-warning-message for the answer.Baskett
@asp_net: Thanks for the addition. I looked through Contents.json, but each entry (except Info) has the filename attribute. I still get the warning. If you'd like I could add the content of the file here so you can look by yourself.Cyano
E
10

If you have icons in .\AppIcons.appiconset folder that is not used/referenced in Contents.json file then you will the warning "The app icon set "AppIcons" has * unassigned children.". Look at all the icons in the folder and go through all the icons referenced in Contents.json then remove extra icons from the folder. Icons that is not referenced even though not included in the project will result in the compiler warning.

Escarp answered 14/3, 2016 at 17:50 Comment(2)
This is actually helped me for most of the icons!Heretic
Also note that you might delete the icon files, which fixes the problem you've described, but then you get errors because there's corresponding lines in the .csproj file that also need to be removed. Those files don't show up anywhere in the IDE, so you'll need to manually edit the .csproj file as well.Retaliate
B
3

iOS 9.2.1, Xcode 7.2.1, ARC enabled

If the JSON file looks good, then the asset catalog might just be corrupt; this sometimes happens when you drag and drop files in and maybe accidentally removing a file from the folder at path, or changing the path in Xamarin for the asset.

Either way, see if Xamarin has some sort of way of deleting the asset catalog and adding it in again, then specifying what iOS target and device your app is going to run on to configure the asset catalog correctly.

You will have to add each asset again to the asset catalog once the catalog is set up.

Hope this helps. Cheers!

Bekelja answered 10/3, 2016 at 20:33 Comment(2)
I had recreated the asset catalog, but that didn't help. Now I moved to Visual Studio instead of Xamarin Studio and now the message is gone. But I keep your tip in mind. Thanks.Cyano
Sounds good! Best of luck! I recently ran into the exact same issue, but removing and adding the asset catalog worked for me in Xcode 7.2.1.Bekelja
C
1

I had the same problem. I had clean up the project and recompile it and all was fine. Also when an icon was missing it was only added when I clean up the project.

Composition answered 15/4, 2016 at 11:57 Comment(1)
It is not answer but commentPhallus
S
0

I had the same problem with VS for Mac, Xamarin, Xcode 9.2. After adding my app icons to Assets.xcassets, I saw the 'Appicons unassigned children' error. The solution that worked for me was to exit Visual Studio and restart it. After restarting Visual Studio, build proceeded without errors.

Satrap answered 5/10, 2018 at 14:35 Comment(0)
H
0

I had a similar problem caused by (possibly) corrupt Contents.json. My Media.xcassets was under a Resources directory. I recreated the asset catalogue from scratch and now it seems to work properly.

Steps:

  1. Back up your Media.xcassets directory.
  2. Create a new AppIcons asset (In Solution view, navigate to iOS project > Asset Catalogs and double-click Media
  3. Click the Add button (top left corner) and choose Add App Icon and Launch Image -> Add App Icon. This creates a new AppIcos.appiconset directory (probably in your project root) and generates an empty Contents.json file.
  4. Add the necessary icons using the corresponding "..." buttons.
  5. See if you still get compilation warnings.
  6. If you wish to move Media.xcassets under Resource or other directory:
    1. Move Media.xcassets to the desired subdirectory
    2. Open Info.plist and .the project .csproj file in a text editor and manually edit all the ImageAsset tags to change their directories from Media.xcassets to Resources\Media.xcassets. Make sure there are no duplicate lines referring to the same assets.
  7. Remove backup Media.xcassets directory
Heteronomy answered 22/3, 2019 at 9:11 Comment(0)
C
0

Another time I got the same warning. Because it is an iPad only app I had this in the concerned Contents.json from the xcassets:

  "images": [
    {
      "scale": "1x",
      "idiom": "ipad",
      "filename": "[email protected]"
    },

I changed it to this

  "images": [
    {
      "scale": "1x",
      "idiom": "universal",
      "filename": "[email protected]"
    },

and the error was gone. You have to do this for every entry.

Cyano answered 2/1, 2020 at 15:27 Comment(0)
S
0

I got also got another warning with the above:

MyApp/MyApp.iOS/obj/iPhone/Debug/device-builds/iphone12.1-13.7/actool/cloned-assets/Assets.xcassets : actool error : Cannot enable on demand resources for the platform "iOS" when targeting releases prior to 9.0. Consider disabling the ENABLE_ON_DEMAND_RESOURCES build setting.

By upgrading from 8.0 to 9.0 the errors were gone for me. I also think the problem came from creating a ImageSet in `Assets.xcassets.

Subvention answered 25/10, 2020 at 14:43 Comment(0)
G
0

My iOS csproj file has old references to deleted files of old xcassets. Just edit the .csproj file and remove these extra references.

Granoff answered 25/10, 2020 at 16:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.