Why is my iOs launcher and appicon not applying? - ios

I need some help figuring out why I can't get a launch icon and appicon to apply to my project. I am running xcode Version 6.3.2. Note: another developer has already applied an appicon The following I have tried:
I created an asset catalog and added new app icon and launcher image via the plus sign button in the lower left of the asset window.
In the general settings of the app I clicked on "Use Asset Catalog" for both the launcher icon source and app icon source. I selected my asset catalog and it prompts me to migrate images, which I did.
My icon and launch icon are not applying even though I have followed these steps. How do I figure out why they are not applying?
EDIT:
All of the slots for the different devices are filled with a .png image. Now that I look at it I wonder if this could be the issue- when I select use asset catalog it migrates my images which creates a new subset of launch icons and all of those slots are empty. With that subset selected my project builds fine. If I select my original subset with the icons in the slots the build fails with message - The app icon set named "AppIcon" did not have any applicable content. Same for the launch icons.

Delete the app from the simulator or device and try again. Due to caching optimizations, sometimes resources are not updated if the name doesn't change.
You might also need to clean your project and rebuild it. Select Clean from the Product menu in Xcode.

It's a long shot, but your Asset Catalog may not be included in your target. Select the catalog file, open the File Inspector and check the Target Membership. Although I believe #Dave Batton has provided the correct answer.

Related

The bundle does not contain an app icon for iPhone / iPod Touch of exactly '120x120' pixels

I've looked at other questions with the same issue and did what was suggested in them but keep getting the same error.
I've dragged 120x120 file into my project, cleaned, built, archived, same error.
I've dragged 120x120 file into the asset catalog manually, cleaned, built, archived, same error.
Here's a pic of my asset appicon:
There is no drag and drop for 120x120. Where am I suppose to add it?
Thanks
Dont drag images in asset.
Go to this link - https://makeappicon.com
Upload your 1024 image, it will email you the icons for iOS and Android as well.
Just copy and paste AppIcon.appiconset file into bundle.
You probably have already solved this, but I'd like to share an observation about this topic as I'm currently struggling with the same problem.
When you generate an app icon set with tools like makeappicon.com, chances are that not all possible icon variants are created. For example, old icon sizes (for iOS 5/6) are probably not produced.
In Xcode's assets editor (at least in Xcode 8.2.1) you only see the slots for which an icon is provided; for me this led to the misinterpretation that all possible icons are present. However, if you manually add an empty icon set in Xcode ("+" -> "New iOS App Icon"), you will see that there are more possible slots then are filled by the icon tool.
In my case the problem was that the deployment target was set to iOS6, but some icons required for iOS6 were not included in the icon set; so I created a new, empty icon set, manually dragged in the files which were created by my icon tool, and then created the missing icons by hand.

How do you provide an icon for an action extension?

All the extension types use the containing app's icon, with the exception of action extension. The Apple documentation says this:
In iOS, a custom Action extension uses a template image version of its
containing app’s icon, which you must provide.
However it does not say how you must provide the icon. It says:
For information on how to add an icon to your app extension, see
Creating an Asset Catalog and Adding an App Icon Set or Launch Image
Set.
But the links to "Creating an Asset Catalog" and "Adding an App Icon" documentation are links to how to add an icon for an app, they don't contain a section on how to add an icon specifically for an action extension.
The extension target does not contain an app icon section in the XCode general settings (unlike an app), so its icon presumably must be added via an asset catalog. However, even after I added an app icon image set to my extension's asset catalog, the extension's icon is still not appearing.
How am I supposed to add an icon for an action extension? And if it's via its asset catalog then why is that not working when I've added an icon image set to the asset catalog?
First, you need to have an asset catalog. You may already have this but if you don't, this is easy to create.
Click on the group that contains the extension files.
From the File menu, select New > File....
In the iOS section, click on Asset Catalog and then click Next.
Second, we need to add the app icons to our project. Note that the icons must have a transparent background. If you try to use icons with a solid background, iOS will not display the icon.
Click the + button and choose App Icons & Launch Images > New iOS App Icon.
By default, Xcode will call the icon AppIcon but it will also warn you that this name is in use. To remove this warning, choose a different name (e.g. AppIconExtension-iOS).
Drag your icons into the 60px placeholder. You will also need 120x120 (aka #2x) and 180x180px (aka #3x) icons. You can create additional icons if you want but these are not necessary.
Third, you need to tell Xcode to use the icon when building the extension.
In the Project Navigator, select your project at the top of the tree.
Select your extension as the Target and select Build Settings.
Search for Primary App Icon Set Name (or Asset Catalog App Icon Set Name before Xcode 15) and enter the name of your icon.
Build and run the extension.
In order to get it to work its not enough to add the assets to the asset catalog - its additionally necessary to set the Asset Catalog compiler options of Build Settings section of the extension to specify the name of the app icon set within the asset catalog:
We need a monochromatic icon for Extension application which has exactly same dimensions & type as we set on Appicon(Only name & icon type is differ).
Firstly we need to include assets to the extension target
Step 1:- For adding assets click on extension scheme->Build phases
->Copy Bundle Resources ->Click + -> Add assets OR Just add by click on assets in your extension target membership.
refer below screen shot
Step 2:- Now for setting up extension App icon click on Extension
application from targets area, Go to build settings ->Search Assets
catalog compiler option ->Enter your App icon name
refer below screen shot
The documentation for action extension icons isn't particularly helpful—try this answer, which provides a worked example, or this answer coupled with the discussion continued in chat.
For the icon itself, current guidance is as follows:
Use a template image for an action extension icon. A template image uses a mask to create an icon. Use black and white with appropriate transparency and antialiasing, and don’t include a drop shadow. Template images should be centered in an area measuring about 70px by 70px.
Got a lot of troubles trying to solve that problem but I eventually found a workaround (I don't like it, but it works):
I ended up installing the last version of Xcode 7.
I opened my project with Xcode 7 and then I followed the steps provided in this answer: https://stackoverflow.com/a/27333408/3844377.
Then I ran my project from Xcode 8 and it worked like a charm.
for Xcode 14, the key has changed to Primary App Icon Set Name in the Build Settings section of the extension

In Xcode, how do I use a different AppIcon for each target iOS App?

I have one Xcode project (in Xcode 6.1) with a 4 targets for 4 different apps that share a lot of the same source code.
I'm trying to have each one of them show a different app icon.
Going into Project > General > [select target] > App Icons and Launch Images, I see this:
But clicking on each AppIcon, I get to the exact same app icons - not the ones that I would like for each project.
Is this just a bug in Xcode? How can I use different app icons for different targets?
Click on your already existing xcassets File, where you have defined the Appicons for your first target and add a new Appicon.:
You can give the new Appicon a meaningfull name (In my case Appicon-Debug):
Go to your targets and select the new target:
choose the new AppIcon under General -> "App Icons and Launch Images" -> "App Icons Source":
Clean the project and rebuild it.
Go to your app's Assets.xcassets and create a new iOS App Icon by clicking on the + button in the bottom left corner of target's section
Name it AppIcon-Test or Debug or whatever name suits you.
Go to xcassets folder and in the utilities panel allow target membership to both in the File Inspector View. Make sure the all target membership's are enabled for both AppIcon sets.
Select the target for which you want to change icon in the project settings. In "General" Scroll down to App Icons and Launch Images. Select your appicon set for the respective target in App Icons source
Happy coding :)
I had a similar issue when using multiple targets. Trying to change which asset set is used just didn't work, it would always just auto select the first one in the list. The way I solved this was to rename the AppIcon in each asset set e.g. AppIconMobile and AppIconTablet.
CLick on the Arrow at right most, which will take you to Xc-assets screen, where you can set images.
Similarly click on other target and set images. If you open your project in finder window, you can notice ProjectName.xcassets where you can see different app icons set. you can copy directly to this folder aswell
I think you just need to create Assets.xcassets for each target
Then create an AppIcon in Asset, no need to give it a different name in each asset
Select the AppIcon on the general section of each target
On top of every other suggestions, you also need to clear Build Folder (top menu Project -> Clean Build Folder), close Xcode, remove app from device / simulator, close simulator, open Xcode and run it again. Otherwise, Xcode will keep cache of your old App Icon.

With Xcode 5 and Asset Catalog, are we still required to include the CFBundleIcons key in Info.plist?

Finally I gut the Asset Catalog of Xcode 5 working for the app icons.
The app supports iOS 6 and up.
The remaining puzzle piece is: Is it still necessary to include a CFBundleIcons key? And do the file names matter?
Apple put together this document which talks about including CFBundleIcons key. I am confused because I don't see what the advantage of Asset Catalog is then.
Some tips for my fellow app developers:
Some icons in the App Icon Asset Catalog have the same size. You can reuse icons. By default, Xcode will copy them. When you drag an icon from Finder to the second placeholder, Xcode will create a heavy copy of your icon. It adds a -1 to the name. When you want to reuse an icon for two placeholders, right-click your "AppIcon" Asset Catalog item in the left under the "Images.xcassets" tab, and select "Show in Finder". You will see a folder named AppIcon.appiconset which contains a Contents.json file. Open this file in a text editor (like Sublime Text or Smultron), search for the file name of the duplicated icon, and rename the entry to match the name of the original. Then delete the duplicated icon.
To reveal the Asset Catalog, click on your project file at the top of the Project Navigator. Select your target. Scroll down to "App Icons" section. Click the arrow to the right.
To remove the gloss effect added by iOS, select your "AppIcon" asset catalog on the left. Then reveal the inspector. Click on the upper right icon in Xcode to show the right panel. Then click on the rightmost icon to see the properties inspector. Check "iOS icon is pre-rendered".
The fat 512x512 and 1024x1024 iTunesArtwork files without extension are only required for enterprise apps which are made for internal Ad Hoc distribution. App Store apps don't need this.
No, you don't need put CFBundleIcons in info.plist again. Xcode automatically add this to pist file. Just create Asset Catalog, set up project and you can upload it.
For my new Apps I just setup Asset Catalog and upload to AppStore well.

Launch Images in iOS 7 with Xcode 5

I've been setting my own names on launch images for my apps in the Info.plist like
with the following images in bundle (with correct dimensions, 320x480 px for default.png and 640x960 px for default#2x.png etc.)
this have been working great prior to iOS 7 and Xcode 5. Now when I look in the General tab for the corresponding target in Xcode 5 my launch image files get mixed up from other targets in my project, which worries me, even though I haven't seen wrong launch image files when actually running the target. Should I be worried? The chosen images isn't in the build target so I should be fine there, but is there a risk of getting a blank image instead?
My main question is, can I use my default setup in Info.plist (that help auto detected respective launch images) for iOS 7, and if so, what should I name the corresponding launch images (now that there's the "iOS 6.1 and Prior" options as well with different dimensions)? This especially applies for the iPad Portrait Retina (iOS 7) that has new dimensions. The auto detection on iPad Portrait Non-Retina (iOS 7) refers to an image, not in the build target, that has the right dimensions. Again, when running a simulator with iPad Retina and iOS 7.0 the correct launch image shows.
Anden, I ran into the same problem today while adding a new target to the half dozen I already had that were set up in the same way that you set up yours.
I decided to use that "Use Asset Catalog" button, which took some work to set up, but has simplified things greatly in the end:
1- (optional) Delete (remove references only) the icon and launch image files from your project. I don't think you need the files to be in the project navigator anymore.
2- Choose your primary target, go to "General" and "App Icons" (as you showed above).
3- Press the "Use Asset Catalog" button, with the "Migrate Launch Images" checked as well.
4- This creates a file called "Images.xcassets" in your project navigator. Go there, and find the App Icon and Launch Image catalogs corresponding with the particular target. You can drag and drop image files from the finder into the slots in the catalog, and rename the icon/default groups from the list on the left.
5- Once you've got the image slots filled up, go back to the "General" for each target, and press the "Use Asset Catalog" button again for each target. Instead of creating a new xcassets file for each, you can store all the launch images and icon files in the same xcassets file.
I think it is a bug in xcode 5. I filed a bug, perhaps you should too (bugreport.apple.com). Make Apple aware things like this are not working well, and are taking our time and nerves.

Resources