App Extension Icon not showing - ios

I have an app extension (Fileprovider-Extension) which Icon is not showing up when I change the FileProvider location (see screenshot). This only happens on Devices (also on the simulator) which iOS Version is 8.4!
I checked already:
Extension have its own images.xcasset-catalog
This images-catalog set an icon for all possible resolutions
The build Settings of the extension Target is updated to this Asset-Catalog also the Imageset that I want to have as Extension-App-Icon
The Asset-Catalog is already in the "Copy Bundle Resources"-Phase of the extension target
When I (initial) tap on the more button to manage my locations, I see (also on iOS 8.4 devices) the AppIcon from the Host-Application... that is really confusing me.
Another device running with iOS 8.1 shows an icon on that point but this is not the icon from the extension xcasset-catalog instead it shows the AppIcon from the Host-Application.
I also try the answers from this question: SO: Why isnt my ios8 application action extension app icon showing up but nothing helps me.
Can someone give me a hint what little point I looked over?

In my case, I first added a new Asset Catalog set to my extension.
In that Asset Catalog, I added an new AppIcon, using the + menu at the bottom. Note the name is: AppIcon
I then added my images to the new AppIcon.
Then under Targets, I selected my extension, then under Build Settings under Asset Catalog Compiler - Options, I added AppIcon to the Asset Catalog App Icon Set Name field.

You have to add a separate Asset Catalog to your app extention, as your app and your extention are not sharing files.
Right click your app extention folder in the Xcode browser on the left -> New File... -> Asset Catalog (Resource).
Then add a App Icon to your asset catalog. Select asset catalog in the Xcode browser -> + -> App Icons & Launch Images -> New iOS App Icon -> Set name: AppIcon.
Last step: You have to set the Asset Catalog App Icon. Go to Build Settings of your extention and search for: Asset Catalog App Icon Set Name and enter AppIcon.
Done!

The best answer for the same as following :
Select Project -> Goto "Build Phase"
Expands the "Compile Source"
Add "images.xcassests" of your mainProject
The bigest advantage of following above step is "Memory Management" + "Decrease Size Of Project Too".
Hope It helps...

Related

Xcode Launch Image Source

I have a very silly question, my xcode project doesn't have setting for Launch Image Source , I have already added my splash screen image to Images.xcassets -> LaunchImage , but in my project target General -> App Icon and Launch Images doesn't have setting for Launch Image Source
I was facing the same issue which I solved this way:
Select your target in the project navigator and find the Build Settings section
Search for the Asset Catalog Compiler options
Go to the Asset Catalog Launch Image Set Name option and set its value to the name of the iOS launch image you created. If you went with the default name, then this value would simply be LaunchImage.
If the new launch screens do not show, it might help to delete your app and install it again.
Also make sure the Launch Screen File option in your target's General Settings is blank.

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

Why is my iOs launcher and appicon not applying?

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.

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.

Xcode 6.1 Warning about Launch Image in Asset Catalog

I am using Xcode 6.1 to create a app supporting iOS 6 and later.
.In target's "App Icons and Launch Images", I set the Launch Images Source as "Use Asset Catalog" and Launch Screen File to "LaunchScreen".
In Images.xcassets which created by Xcode, I fill in every box for "LaunchImage", but there's always a warning message:
Retina 4-inch Support. Applications using Launch Screen Files and
targeting iOS 7.1 and earlier need to also include a Launch Image in
an Asset Catalog.
I created another Image Set named as "Default" and fill in the "Retina 4 2x" box with expected image. But the warning message still there.
Any hint to clear this warning? Thanks.
I ran into the exact same problem this morning. Here's how I fixed it.
Select your Target in the project navigator. Under the General tab, you should see the section for App Icons and Launch Images. Where you see Launch Images Source, click 'Use Asset Catalog'.
You will then see Migrate launch images to an asset catalog dialogue. Click 'Migrate'.
Make sure that your Launch Images Source on the previous screen points to the right image set in your asset catalog. In your case, you would set it to 'Default'.
That should take care of the warning.

Resources