Why PhoneGap always shows default splashscreen image? - ios

I'm testing a sample iOS app now, although I set all new launch images in Xcode (Summary tab of Project Target screen), PhoneGap 3.0 keeps showing its default splashscreen. Why? even when splashscreen is a plugin and not included by default in PhoneGap 3.0 now.
iOS document say about launch images but not splashscreen, and it even strongly recommend us to use a "first screen" similar as launch image, not something like about screen. Are these same?

It's not about cleaning or caching issues at all. The problem is PhoneGap includes all possible launch images in project template by default. These files are under Resources folder and copied to bundle's root folder on build event. Although I properly selected my own launch images in Xcode (Target/Summary screen), default PhoneGap's specific files e.g. Default~iphone.png overridden my files :(
Once issue is identified, you can fix it someway, but I prefer below steps:
Delete all default icons and splashscreen files under /platforms/ios/AppName/icons and /splash folders. You surely don't need these placeholder images.
In Xcode, select Targets/AppName, then tab Build Phases, delete all file names of images in the above step in section Copy Bundle Resources.
Add your own images files for app icon and launch images here.
Edit Info.plist file (file AppName-Info.plist under /platforms/ios/AppName/) to include your images, you will need to use CFBundleIcons and UILaunchImageFile keys. Go to iOS developer site for reference.

Splashscreen and launch image are the same thing.
You probably did everything right but iOS (especially in the simulator) often just doesn't change those things (splashscreen, icon etc.) during development process. Try to delete your app, clean your project (in Xcode: Product -> Clean (shift+cmd+k)) and reinstall your app.

Related

Missing CFBundleIconName in Xcode9 iOS11 app release

I'm struggling to release a new version of our app using Xcode 9 built with iOS 11 SDK. Archiving and uploading the binary goes well without any issue. The build appears in iTunes Connect under Activity as 'processing' and it gets disappear and I get the following email back.
Dear developer,
We have discovered one or more issues with your recent delivery for
"". To process your delivery, the following issues must be
corrected: Missing Info.plist value - A value for the Info.plist key
CFBundleIconName is missing in the bundle ''. Apps that
provide icons in the asset catalog must also provide this Info.plist
key. For more information see
http://help.apple.com/xcode/mac/current/#/dev10510b1f7. Once these
issues have been corrected, you can then redeliver the corrected
binary. Regards, The App Store team
The link gives some info about asset bundles. I tried setting a CFBundleIconName key to project name or an image file name and submitted the app again. However, I still get the same email as above.
Any suggestion of help would be highly appreciated.
I struggled with this all day and into the night trying every permutation I could think of and finally found this solution - hopefully this will save someone from going through this nightmare.
My app was not previously using an xcassets catalog so I had added one to the project when trying to address this issue by using File - New - File... and choosing an asset catalog from the types of files - I named it Assets.xcassets and chose it in the xcode project. Then right clicked in the area on the right and chose to add App Icons & Launch Images then New iOS App Icon and then in that I dragged my 1024x1024 image to the well for app store iOS 1024pt slot which you would think would have worked. but I still got rejected emails after archiving and submitting to the store.
Missing Info.plist value - A value for the Info.plist key CFBundleIconName is missing in the bundle. bla bla bla...
I also had added the key to the Info.plist for "Icon Name" which is also known by CFBundleIconName and set it to a string filename that matched my 1024x1024 image in the project. But none of that worked even though checking the IPA contents showed everything correctly in place.
finally I deleted the AppIcon from my catalog called Assets.xcassets so that it was empty and did the following to fix the issue:
Go to the main setting for the app by clicking your app name and then selecting the GENERAL tab then under App Icons and Launch Images section click the button beside App Icons source and choose to use an asset catalog - select the name of your asset catalog - mine was called Assets.xcassets - and say to convert (migrate) the app with the button on that popup - I also checked the box to convert launch images too - when you are done the App Icons Source and the Launch Images Source will have names in the dropdown list.
go to the asset catalog by clicking on it - again mine was Assets.xcassets and then click on the AppIcon section and drag your 1024x1024 image into the App Store iOS 1024pt well / slot. archive your app one last time and submit it to the app store - at that point hopefully won't get anymore emails from hell as I started calling them about rejection of your app and you can return to iTunesConnect to submit your app.
Good luck - I empathize with the pain you might be feeling with this mostly cryptic error when you have tried lots of reasonable fixes that just didn't pan out. Such is the life of a software engineer sometimes... ;)
if it was easy everyone would do it, right. ;)
Simplest solution is to add CFBundleIconName key in plist and fill all AppIcon slices in assets catalog.
Info.plist :
<key>CFBundleIconName</key>
<string>AppIcon</string>
Download Working AppIcons Assets Here
I figured it out that since Xcode 9 iOS 11 builds require iTunes Connect App Icon to be bundled with the binary itself which could have been added to iTunes Connect directly in the earlier versions of Xcode (XCode 8.3.3 ane earlier).
If you distribute your app through the App Store, add the App Store
icon to an asset catalog located in the Xcode project. The location of
the icon is different depending on the platform.
For iOS and watchOS apps built using Xcode 8.3.3 and earlier, you add
the App Store icon in iTunes Connect. For macOS and tvOS apps, you add
the App Store icon to the Xcode project but the location in the asset
catalog is different than apps built with Xcode 9 and later.
The required App Store icon should be placed in an asset catalog located in the app bundle.
So, the CFBundleIconName should be now set to AppIcon (default value) or any value you set.
Adding only that image will not pass the iTunes Archive upload process so we need to add all the App Icons images of the following sizes:
20pt 1x, 2x, 3x
29pt 1x, 2x, 3x
40pt 1x, 2x, 3x
60pt 1x, 2x, 3x
76pt 1x, 2x
83.5pt 2x
1024pt 1x
So, now it is time to use asset catalog to specify app icons.
I was getting the same email whenever I submitted a binary for a new version of one of my apps. I tried all the remedies listed here, but nothing worked. Then I made one more change that worked.
In the Target . . . Build Settings . . . Asset Catalog Compiler - Options section, make sure the name of the asset catalog that contains the icons is shown in Asset Catalog App Icon Set Name. For some reason, my Asset Catalog App Icon Set Name was blank.
I have got the same issue and solved it as follows.
Here is the step by step guideline.
Step 1:
Create an icon with 1024*1024.png
Step 2:
Upload this png to the https://www.appicon.build/ website and drag and drop on screen.
Step 3:
It will ask you to enter your email address. Enter it and then after few seconds, you will get all the required image sizes into your mailbox. Download that zipped folder and unzipped it.
Step 4:
Go back to your project on Xcode and add this unzipped folder(called AppIcon.appconset) into the resources folder in your xcode project.
Step 5:
Double click on Asset.xcassets folder and drag and drop required images on the image placeholder for 2x and 3x images from the generated images.
You are good to go!...
Apps built with iOS 11 or later SDK must supply app icons in an asset catalog and must also provide a value for this Info.plist key
For older projects without assets catalog there will be issues while submitting to Appstore
In Project —> Target Properties - General tab—> App Icons and Launch Image.
App Icons —> Select Use Asset catalog
Then it will ask to convert (migrate) with an alert and creates a .xcassets file. Check the box to convert launch images too.
When you are done the App Icons Source and the Launch Images Source will have names in the dropdown list.
Add the app icons and other icons to it
Now in IOS 11, we need to add a new icon in our project of size 1024x1024.
Ensure that the Icon files are removed from resources folder in source code bundle and also Icons files key in info.plist is cleared.
Also add CFBundleIconName key in plist as below
Info.plist :
<key>CFBundleIconName</key>
<string>AppIcon</string>
Also in the Project - Target—>Build Settings —> Asset Catalog Compiler - section, make sure the name of the asset catalog that contains the icons is shown in Asset Catalog App Icon Set Name.
I too have encountered the "Missing Info.plist value - A value for the Info.plist key CFBundleIconName is missing in the bundle..." error and wanted to leave a concise answer to hopefully help the next person.
The app was not using an asset catalog. Although that is not what this error says, that is what is required to resolve this issue, but how you add the values is important. It is not enough to manually add this missing key\value to the .plist; there is more to it than that. You also need to remove the CFBundleIcons value from your .plist. This can be done manually, but I recommend using the XCode interface to edit this through the Project Properties - General App Icons and Launch Image. That is how I got mine to work.
Below is a screen shot of the changes this made to my .plist.
App Icons and Launch Images
Add a new Asset Catalog to your project if you do not already have one.
Click the app name at the top of your Navigator window
Select the GENERAL tab
Scroll down to the "App Icons and Launch Images" section
Click the "use an asset catalog" button
NOTE: I had created my own asset catalog and iOS App icon image set, but linking to the existing one didn't work for me as it created a new image set which had empty values\images. I had to delete them all and let this process create them for me. If you are just now adding an asset catalog to resolve this issue, let this process create it for you, don't manually add the image set.
Click to convert\migrate the app
After clicking the button, nothing refreshed automatically for me. I navigated away and then back to the settings screen and values were now assigned in the dropdown list.
Now open your new asset catalog by clicking on it
Click on the "AppIcon" section and drag your required images to the appropriate locations.
You will need the 1024x1024 image for the App Store iOS 1024pt icon and any other iPhone\iPad\Universal app required icons. The 1024x1024px image is also known as the Marketing Icon. You cannot submit your app without it.
You should now be able to archive your app and submit it to the app store.
For anyone who the above answers did not help(spent a good bit of head-wall banging on this one):
Make sure to check the target membership of your assets directory! If you do not correctly link the membership here, you will get this same super-generic error(Apple should do something about the error messages).
The target membership should correlate directly to targets for which you are using the icons. For example, I use this single directory for both my main app, and watch app assets, you must specify this by selecting the appropriate member.
You do not need to edit the plist at all, most of these answers are misleading.
Hope this helps someone who hits this!
Follow the steps below.
In your Project add new file>>Asset Catlog.
Goto Click on your project in XCODE>>General>>App Icons. See screenshot.
This will create AppICon and LaunchImage Specifications automatically inside your Asset after that you can drag and drop your Appstore icon and other icons in it.
Also Add
<key>CFBundleIconName</key>
<string>AppIcon</string>.
This entry in your plist file.
Upload Your Binaries to Itunes.
In my situation; after you have done all these things in this page, don't forget to archive your project again :)
No need to edit info.plist. The icon related errors would be resolved by filling in all the images placeholders for AppIcon in images.xcassets.
I have finally come up with a clean solution to this problem which requires adding no keys to info.plist such as CFBundleIconName. I did this while updating an old app in the app store to build against SDK 11.2 (and believe me there was a fair amount of frustration involved). I'm using Xamarin in Visual Studio on a PC but this solution should work in any other IDE or framework e.g. XCode. The gist of the solution is that info.plist file and Resources folder no longer need to play any role as far as app icons and launch images are concerned. In fact you can remove CFBundleIconFiles key from info.plist file and it will not make any difference to your project.
Here are the steps you need to follow:
Make a copy of your app icons and launch images and store them in a separate location.
For a clean start delete references to app icons and launch images from info.plist, which means deleting values under CFBundleIconFiles key.
Delete app icons and launch images from Resources folder.
Use delete option to delete any 'Assets' or 'Media' you have declared under 'Asset Catalogs'.
A folder by the name of Assets.xcassets or Media.xcassets (or similarly named .xcassets folders) might still be present in your project. They would either be outside or inside the Resources folder. Delete all .xcassets folders.
Now open your project file in an editor like notepad (i.e. .csproj in Visual Studio) and see if there are any references pointing to files in .xcassets folder. Delete all such references. Also check that there are no references pointing to app icons or launch images under Resources folder in this file and delete them as well.
Check to make sure XSAppIconAssets and XSLaunchImageAssets keys are no longer present in info.plist. Delete them if they are still present.
At this point you have removed any previous files or references to your app icons and launch images from your project. If they are still present please go back and delete them. Now to start afresh create a new 'Asset' or 'Media' under 'Asset Catalogs' which creates a .xcassets folder in your project. Copy your app icons (and launch images if required) from step 1 into respective folders under your new .xcassets folder. Make sure all required images are included.
Check to make sure info.plist now contains XSAppIconAssets (and XSLaunchImageAssets if needed) key values for the new 'Asset' you have created. Your project file (which is .csproj in Visual Studio) should now contain references to each image you added to your new 'Asset'. There is no need for any extra images than those required by the project. I would suggest deleting any extra images from your Assets.
If you added a key named CFBundleIconName as mentioned in other solutions then please delete this key from info.plist. It is not required. Now you are ready to submit your app to the store.
There was an issue with Visual Studio 17(v-15.2) once you update it version > 15.2 you will see an App-Icon-1024x1024 place holder in AssetCatalog > Media> AppIcons
Every app developer uses the famous "Icon Dog"
(it's a shame they changed the name!)
https://itunes.apple.com/us/app/app-icon-set-creator/id1052532083?mt=12
It's far and away the #1 most popular app used by iOS devs, kind of a cult.
It immediately solves all problems.
If anyone is, like me on this page amongst many because you cannot get an app pushed to the app store -- and when you do, you get an email about missing asset catalog.... 16.10.0 is completely broken. 16.11.0 preview does not fix it either. I have one Xamarin project still publishable, but I suspect if I deleted the build cache on my mac it wouldn't ever work again. After 5 days solid, I downgraded to 16.8.6 (likely did not need to go that far back). I started getting useful warnings about images again, and my asset catalog not only generates an asssets.cer, but the bundle has the catalog properly added. Whether it started working from visual studio or the mono downgrade to the old version, I do not know, but hopefully this saves someone the wasted days I endured trying to adjust info.plist, catalog.json, .csproj, wiping mac side caches, inspecting published files, 1000's of build/archive/transports, and renaming and double-checking thousands of icon files, completely rebuilding projects, etc.. You can work around the missing asset catalog by implementing the CFBundle icon files if you manage to get them perfect, but if you succeed at that, you will upload the app, it will promptly disappear, and appstore connect will email you that all apps now need asset catalogs.
For me the key was to check the target membership checkbox of Assets.xcassets
I had this issue with a Flutter app when trying to upload an archive.
Fix:
Add the following to Info.plist
<key>CFBundleIconName</key>
<string>AppIcon</string>
Tools > Flutter > Flutter Clean
Tools > Flutter > Open iOS module in Xcode
Create a new archive and upload.
For Xcode 9.2 for iOS 11 apps, a couple points should be clarified.
1- This error should be from not having icon assets in an Asset Catalog.
(Got this error by submitting an app with no asset catalogs).
2- This error is solved by adding an asset catalog with the required icons.
(In my case, it was an iPhone-only app, and I added some placeholder images that were 120x and 180x).
3- This error is not related to the 1024x1024 "App Store Icon"
(When you forget the larger store icon, a separate, specific error will be displayed, not this error).
4- Contrary to the Apple documentation, even with (Xcode 9 + written for iOS 11), you can also use the website to submit the App Store icon.
(The separate specific error mentioned above is triggered by the lack of an icon, not the absence of the icon in the submitted build).
5- missing CFBundleIconName in Info.plist was not changed.
I had also a lot of problems on this matter - I was constantly getting the error with the missing CFBundleIconName and that my Icons where not found. So here is my story, maybe it will be of help for somebody. By the way, I am using Visual Studio with Xamarin.
Add an Asset Catalogue to your Project with AppIcons (the actual name of the asset is not important but just that it is for the application icons). Add all of the necessary icon sizes. For the 'App Store' icon I have added an icon without a # in the name as someone in the forums suggested, but I am not sure, if it is 100% necessary. For generating the different icon sizes there are a lot of Websites and tools that can do that for you and you just need to provide the 1024x1024 one. They will generate the rest.
In the Info.plist under 'Visual Assets' and then 'App Icons' set the source to the asset that you have just created.
Now check your Info.plist. Do not open it with an external Editor, because all of your changes will be overwritten once you build your project. Do the following - right mouse click on the Info.plist in the Solution Explorer then select Open With -> Generic PList Editor.
Check that you have the following entries:
-Property = CFBundleIconName, Type = String. Value = Assets.xcassets/AppIcons.appiconset
-Property = XSAppIconAssets, Type = String. Value = Assets.xcassets/AppIcons.appiconset
Note that Visual Studio automatically adds, when it adds something altogether, 'Resources/Assets.xcassets/AppIcons.appiconset' as the Value. But in my case the Asset Catalog was created outside of the Resources folder and therefore, my icons where not found. So, check where your assets folder was created.
CFBundleIconFiles was not needed, because Apple uses the Asset Catalog instead now.
I hope that I was of some help :)
I used the answer by #Omair and it is spot on, however, I then was getting errors that various icons were not found. The problem was a bug with VS2017 when creating an asset catalog. When adding a new asset catalog, the catalog folder is created under the root of the project, not under /resources. However, the entry in info.plist has the path as under /resources. Once I removed /resources from the path to my asset catalog all worked fine. Hope this helps someone!
I'll reply in the scope of Xamarin for fixing this issue - which is similar but not identical to Xcode. Using VisualStudio Community (16.6 Windows/ 8.6.1 macOS) with Xcode 11 installed on macOS
Adding the CFBundleIconName in the Info.plist is no help, this key is no longer used nowadays (for builds targeting iOS 11 and above, only Assets.xcassets is used - it also can be Media.xcassets, you choose whatever you want, but i'll reference it as Assets.xcassets).
My issue was: although it was visually nice in Assets.xcassets view, the images were not corrects. As soon as i tryed manually to reaffect them i had a format error.
Xamarin is handling, well... let's say confusingly the Asset.xcassets into the .csproj file. Sometimes referencing Contents.json file is not enough to describe all assets, you have to import every single file too, so it can work on PC, but not on Mac and vice-versa. There is space to improve assets management between Visual Studio PC, Visual Studio Mac and Xcode.
I re-generated all icons, and inserted one by one to the Assets.xcassets view by hand.
Of course, in addition, Info.plist, you must have the following key:
<key>XSAppIconAssets</key>
<string>Media.xcassets/AppIcons.appiconset</string>
Then i rebuild all and voilà, it worked.
Tip to see if icons are generated correctly before uploading to AppStoreConnect is to deploy to simulator, or, in Xcode->Organizer tool to check if the IPA got the proper icon. Otherwise this is dev "no icon", and it won't be okay.
Also, some websites for app icon generation are not containing everything i needed. Finally, i used this one for quick tests (but i prefer local tool - see above): https://www.iconsgenerator.com/Home/AppIcons
Also, because you could have issue uploading without Launchimage (related to storyboard, and also stored in Asset.xcassets, there is a wonderful app allowing both generation of App Icons and Launch Images: https://github.com/raphaelhanneken/iconizer
In My case issue was that I had a PNG image for the App Store Marketing Icon (1024x),
You must use jpeg, Non-transparent image for this App Store icon (1024x), and the issue went away.
Nothing above worked for me. I needed to remove the value for Development Assets from Build Settings.
Deleted the existing "Assets" folder under Asset Catalogs
"Add New"'d an empty "Asset Catalog"
followed Managing Icons with Asset Catalogs
info.plist updates: +1 your version and build #'s and add icons placed in Resources as "required?" by some earlier iOS's
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconName</key>
<string>AppIcon</string>
<key>CFBundleIconFiles</key>
<array>
<string>Icon152</string>
<string>Icon167</string>
<string>Icon76</string>
</array>
</dict>
To which Apple replied:
The following build has completed processing: Platform: iOS App
Name: FltLogger Build Number: 1.6
Putting this here as much for me next time as to help out. Happy hunting...
In my case I tried everything, the only thing that worked is that i had to delete the whole xassets folder and create a new one with the icon files in it.
If you are still facing with the issue and you are using XCode 13, maybe the solution is to remove the info.plist key. I explain more here: https://stackoverflow.com/a/71016589/15860448
In my case I had done everything as I should. The plist, the AppIcon, the settings in General and Build Settings.
What was the issue actually was that the name of the App in AppStoreConnect was different(by one capital letter), than the name of the one in XCode. So what I did was to create a new project with the correct name, just copy/pasted everything and it worked.

What are the sizes required for React-Native app icons? [duplicate]

I am making a React Native app. I would like to customize the app icon (meaning the icon that you click on to start the app). I have Googled this, but I keep finding different types of icons that refer to different things. How do I add these types of icons to the app?
iOS Icons
Set AppIcon in Images.xcassets.
Add 9 different size icons:
29pt
29pt*2
29pt*3
40pt*2
40pt*3
57pt
57pt*2
60pt*2
60pt*3.
Images.xcassets will look like this:
Android Icons
Put ic_launcher.png in folders [ProjectDirectory]/android/app/src/main/res/mipmap-*/.
72*72 ic_launcher.png in mipmap-hdpi.
48*48 ic_launcher.png in mipmap-mdpi.
96*96 ic_launcher.png in mipmap-xhdpi.
144*144 ic_launcher.png in mipmap-xxhdpi.
192*192 ic_launcher.png in mipmap-xxxhdpi.
Update 2019 Android
The latest versions of react native also supports round icon. For this particular case, you have two choices:
A. Add round icons:
In each mipmap folder, add additionally to the ic_launcher.png file also a round version called ic_launcher_round.png with the same size.
B. Remove round icons:
Inside yourProjectFolder/android/app/src/main/AndroidManifest.xml remove the line android:roundIcon="#mipmap/ic_launcher_round"and save it.
Otherwhise the build throws an error.
I wrote a generator to automatically generate icons for your react native app from a single icon file. It generates your assets and it also adds them correctly to your ios and android project:
Update (04/09/2019)
We revamped our generator to be up to date with the ecosystem standards. You can now use #bam.tech/react-native-make.
You can install it using: yarn add #bam.tech/react-native-make in the react-native project
To use it react-native set-icon --path <path_to_png> --background <icon_background_color> --platform <android|ios>
And... that's it! Hope it can be useful for others :)
Recommendations:
1024x1024 base image
No transparent background for iOS
An icon which follows adaptive icons guidelines for Android
Here are some improvements over the previous tool: 🥳
No Yeoman dependency, it is now a react-native-cli plugin
No Image Magick dependency
Creates Adaptive icons for Android
Adds missing icons sizes for iOS
I would use a service to scale the icon correctly. http://makeappicon.com/ seems good. Use a image on the larger size as scaling up a smaller image can lead to the larger icons being pixelated. That site will give you sizes for both iOS and Android.
From there its just a matter of setting the icon like you would a regular native app.
https://help.apple.com/xcode/mac/8.0/#/dev10510b1f7
Set icon for Android application
I was able to add an app icon to my react-native android project by following this guy's advice and using Android Asset Studio
Here it is, transcribed in case the link goes dead:
How to upload an Application Icon in React-Native Android
1) Upload your image to Android Asset Studio.
Pick whatever effects you’d like to apply. The tool generates a zip file for you. Click Download .Zip.
2) Unzip the file on your machine. Then drag over the images you want to your /android/app/src/main/res/ folder. Make sure to put each image in the right subfolder mipmap-{hdpi, mdpi, xhdpi, xxhdpi, xxxhdpi}.
3) Do not (as I originally did) naively drag and drop the whole folder over your res folder. As you may be removing your /res/values/{strings,styles}.xml files altogether.
Android Studio has a very handy icon asset wizard called Image Asset Studio (user guide here). It's quite self explainatory, and has a few handy effects and it's built right in:
Screenshot from Android Studio 4.1.3 on Windows 10
Someone made a very easy to use tool just for this task: https://www.npmjs.com/package/app-icon
This simple tool allows you to create a single icon in your react-native project, then create icons of all required sizes from it. It currently works for iOS and Android.
I've used it. Made a 512x512 png and then ran that tool and boom, done. Super easy.
You'll need different sized icons for iOS and Android, like Rockvic said. In addition, I recommend this site for generating different sized icons if anybody is interested. You don't need to download anything and it works perfectly.
https://resizeappicon.com/
Hope it helps.
This is helpful for people struggling to find better site to generate icons and splashscreen
Make App Icon (useful for both android and ios)
APE tools (useful for both android and ios)
Icon set creator (useful for ios only)
Andoid Asset Studio(useful for android only + recommended*)
Steps Android App icons:
Go to this website https://appicon.co/
Add image their and generate icons, it should be downloaded
Unzip the folder
Inside their copy all the folders in AppIcons/android/ (i.e. Folder
names: mipmap-xxxhdpi,mipmap-xxhdpi,mipmap-xhdpi,mipmap-hdpi,mipmap-mdpi)
paste above copied folders into {rootFolder}/android/app/src/main/res/
and replace existing ones
Remove this line from AndroidManifest.xml
(android:roundIcon="#mipmap/ic_launcher_round")
Icons are successfully added
Change IOS App icons:
Go to this website https://appicon.co/
Add image their and generate icons, it should be downloaded
Unzip the folder
Inside their copy all the folders in AppIcons/Assets.xcassets/ (i.e.
AppIcon.appiconset folder)
paste the AppIcon.appiconset folder into
{rootFolder}/ios/{projectname}/Images.xcassets/ and replace existing one
Icons are successfully added
If you're using expo just place an 1024 x 1024 png file in your project and
add an icon property to your app.json i.e. "icon": "./src/assets/icon.png"
https://docs.expo.io/versions/latest/guides/app-icons
For setting the App launch icon for Android Devices in a React-Native project:
Take a high resolution image of your logo and place it inside your project directory. Preferably in [Project-DIR]/android/app/src/main/res/
Open Android Studio and run your React-native project.
In Android Studio's Project window, select the Android view
Right-click the res folder and select New > Image Asset
A "Configure Image Asset" window will open; Locate your high resolution image and place set it as your "Foreground layer".
Set your "Background Layer" if applicable
Click "Next" and continue to finish.
Run your application again to see the new app launch icon.
Official documentation can be found here: https://developer.android.com/studio/write/image-asset-studio
Use this library to make your work easier.
It will automate your Icon generation process
https://www.npmjs.com/package/#bam.tech/react-native-make
Update 2022
Since the Almouro's Answer is no longer maintained
Android and iOS icon
You can now generate icons with one command both for iOS and Android with rounded icon:
npx icon-set-creator create ./path/to/icon.png
I highly recommend using an icon with a size of at least 1024x1024 pixels
Adaptive Android icon
npx icon-set-creator create -b <background> -f <foreground> -A
background - The color (E.g. "#ffffff") or image asset (E.g. "assets/images/christmas-background.png")
foreground - The image asset (E.g. "assets/images/christmas-foreground.png")
I personally use this link to generate my desired icons https://appicon.co/
And for importing inside the application.
For IOS Setup
Click on your project from Xcode ==>
then on the left side you will see your click on that ==>
Now you will see subfile name Images.xcassets click on that ==>
you icons size will be displayed on the right hand window ==>
simply drag and drop the icons which we have generated from https://appicon.co/ ==>
and your IOS ICON SETUP IS DONE.
Moving to Android
We will go to Android ==> app ==> src ==> main ==> res
Here you will various folders named mipmap-hdpi till xxxhdpi ==>
Drag the icons from the specific folder to your project specific folder.
Happy coding!
To import icons on React Native if you want the icons without having the pictures, then react-native-vector-icons would be the best one. You can use it if you don't want to download the icons and use it in your project.
I would like to suggest to use react-native-vector-icons to import icons to your project. As you use vector icons, you don't need to worry much on icon scaling side. While using the package you are able to use all popular icon set such as fontawesome, ionicons etc..
Besides these iconsets you can also bring your own icons too to your react-native project by packing your icons as a ttf file and you can import that ttf directly to both android and ios project. You can utilise the same react-native-vector-icons library to manage those icons
Here is a detailed procedure to setup custom icons
https://medium.com/bam-tech/add-custom-icons-to-your-react-native-application-f039c244386c
You can import react-native-elements and use the font-awesome icons to your react native app
Install
npm install --save react-native-elements
then import that where you want to use icons
import { Icon } from 'react-native-elements'
Use it like
render() {
return(
<Icon
reverse
name='ios-american-football'
type='ionicon'
color='#517fa4'
/>
);
}

Missing required icon file. The bundle does not contain an app icon for iPad of exactly '167x167' pixels, in .png format when trying to upload app

I successfully uploaded my app on Xamarin forms but after it was uploaded I received this in an email from apple:
"Missing required icon file. The bundle does not contain an app icon for iPad of exactly 167x167 pixels, in .png format ."
So it wants an image in my resources file I suppose (not in info.plist icons as they are not asking for 167x there) but should I name it: Icon-83.5#2x.png or Icon-174.png?
Go to xcode > select Images.xcassets > check ipad from the right menu at the top right > you will get new set of dimensions, now it's easy as fill your new app icons for each dimension.
I've had this particular problem in the last couple of days.
The iPad icon didn't show within the Info.plist and kept giving the warning you're getting right now.
My fix was to manually add the icon Icon-83.5#2x.png to the resources folder ( as Prashant pointed out ) and add this to the Info.plist:
<key>CFBundleIconFiles</key>
<array>
<string>Icon-40.png</string>
<string>Icon-40#2x.png</string>
<string>Icon-40#3x.png</string>
<string>Icon-60#2x.png</string>
<string>Icon-60#3x.png</string>
<string>Icon-76.png</string>
<string>Icon-76#2x.png</string>
<string>Icon-83.5#2x.png</string>
<string>Icon-Small-40.png</string>
<string>Icon-Small-40#2x.png</string>
<string>Icon-Small.png</string>
<string>Icon-Small#2x.png</string>
<string>Icon-Small#3x.png</string>
</array>
I used to work with Asset Catalog but I couldn't get it to work with the iPad Pro icon.
For the forum post Andres mentioned in the comments:
Rename the 167x167 icon file to Icon-83.5#2x.png, place it in the Resources folder, and make sure it has a build action of BundleResource.
See https://developer.xamarin.com/guides/ios/application_fundamentals/working_with_resources/ for information about setting BundleResource option.
XCODE 13 2022
In my case, the problem was default AppIcon is deprecated, then we need to use a new App Icon standard. As I publish apps to iPhone and iPad I need all the necessary icons. (This issue no appear when you check only one device(iPhone or iPad))
Go to Xcode >Images.xcassets> And select your App Icon from the assets list.
Right-click on there, You can now see a menu list like that
Select iOS>New iOS App Icon
Then you can find now a new "AppIcon" asset named "AppIcon-1"
There is a difference to "AppIcon" because It has more icons options(iPad icons size)
Remove "AppIcon" (OLD)
Rename your "AppIcon-1" to "AppIcon"
Now you can put the missing icon size.
Xcode 14.1 (14B47b)
You're getting this error because you have checked the iPad option. In my case, I had been developing my app on Xcode 13.x and then after the new version of Xcode 14.x I got this error.
So on Xcode 14 there is no need to create app icons in various versions and put them inside Images.xcassets, just follow the steps:
Click on the Images:
Then try to press + and choose iOS App icon:
You will see it got changed by comparing it to the previous version, it only accepts one and only one 1024x png image.
Now, clean your last build and build your app again.
But if still you want to use the previous version, you can click on AppIcon and then after choosing it, open the right panel of Xcode:
Then by choosing All sizes you would be able to see the previous version set.
I use Visual Studio 2017 on a Windows machine with a MacBook connected to it. I have an Asset Catalog called images that contains an image set called AppIcons where I have posted all of the various required image sizes. I was getting the same error as medvedo except I was getting three errors for 3 different images sizes (2 for ipad and 1 for ipod as I recall) After a lot of searching I found the solution was to reference the Asset Catalog in the Info.plist file.
First I had to find the path that Xamarin was putting my asset catalog in. I did that by deploying the app to the MacBook and then using Finder I went to the Go menu and chose the Library folder (earlier in the day I Googled how to show hidden folders on the Mac) In the Library folder I found the Caches folder and in that I found Xamarin/mtbs/builds/myappname There I found that the folder was Images.xcassets/AppIcons.appiconset. I say all of this knowing that it might always be in that folder but I had to look it up so I thought I would share in case it changes from installation to installation.
Once I knew the path and name I was able to add the following to my Info.plist file inside of branch
XSAppIconAssets
Images.xcassets/AppIcons.appiconset
FYI - I have built and deployed this app to iTunes at least 4 times over the previous 8 months. I am not sure what I did, if anything, to cause the error to pop up.
After trying many things, this is how I fixed the "Missing required icon" error messages:
Go to Solution->ProjectName.iOS->Asset Catalogs->Assets.
See "AppIcons" there? We are going to delete it, BUT FIRST! Find that same folder in your project files and copy it somewhere safe. Now, delete the AppIcons asset in the project. Also delete the "Assets" catalog.
ProjectName.iOS right click select 'Clean'. Go to physical project folder. Delete the "bin" and "obj" folders. Find the empty "Assets.xcassets" folder and delete it as well.
ProjectName.iOS->Asset Catalogs right click select "Add Asset Catalog". It should automatically add an "AppIcons" entry. Go through and set each of the image sizes, pointing to where you copied your images. They will automatically be copied to the Assets.xcassets folder. They will also generate hidden entries in the ProjectName.iOS.csproj file that will include the image in the final binary. The entries look like this:
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\1024.png">
<Visible>false</Visible>
</ImageAsset>
Edit Info.plist. Set the App Icons Source to "AppIcons".
ProjectName.iOS right click, select "Rebuild". ProjectName.iOS right click, select "Archive". Archive Manager > Distribute > App Store. Verify certificate. Enter Apple login name and App-Specific password to upload. Done!
If you are still facing issue with all the above process steps performed correctly.
Then please check you are logged into appstore connect using your browser and then try to publish it will and work.
If you do not want the app to be available for ipad and getting the same error just uncheck ipad from runner properties below version number

My binary is not optimized for iPhone 5 while having localized splash screens

My app keeps getting rejected as an invalid binary after uploading it to iTunesConnect via ApplicationLoader. The e-mail notification I'm getting is:
Your binary is not optimized for iPhone 5 - - New iPhone apps and app updates submitted must support the 4-inch display on iPhone 5 and must include a launch image with the -568h size modifier immediately following the portion of the launch image's filename. Launch images must be PNG files and located at the top-level of your bundle, or provided within each .lproj folder if you localize your launch images. Learn more about iPhone 5 support and app launch images by reviewing the 'iOS Human Interface Guidelines' at /.../
Which is weird as I'm packing all splash screens in the binary, checked that through extracting my .ipa aswell and they are there (in their respective .lproj-s), correctly named and of correct sizes. I do not use the Asset Catalog, as I haven't found a way to localize that (yet).
What could be the issue for the rejection?
I also face the same problem in my case myapp plist file contains key "Launch Image" after remove the key from plist issue fixed on validation.
The issue here seemed to be that it was expected that the splashes would be in EVERY localization folder, even if I didn't localize the splash for that particular language. INCLUDING Base.lproj. After copying the english splashes into default, the app got through the initial check and is awaiting review as we speak.
We faced the same issue and couldn't solve it after trying many solutions, we believe it's a kind of bug in App submission.
But we found a workaround which can keep launch images localized and pass the submission verification.
Environment:
Xcode 6.1 (6A1052c) with iOS 8.1 SDK
Precondition:
Have following properties in your "*-info.plist" file.
Steps:
Go to your target's settings and in our standard scenario (localize
launch images, which uses "UILaunchImages" in "*-info.plist" but not
image assets), it should look like the image
Change the setting to use image assets (Note: after this step, Xcode will automatically REMOVE the "UILaunchImages" properties in your *-info.plist file. So please BACKUP the properties first.)
Go to the "LaunchImage" assets (can click the arrow button on the right) and fill with images from one of your *.lproj folder.
Now, go to the "LaunchImage" folder which contains images and "Contents.json" file.
Remove ALL the launch IMAGES just added, but kepp the "Contents.json" file.
Check the "Contents.json", it should contains properties like image below
Double check following items:
*-info.plist contains "UILaunchImages" properties
Project setting uses image asset for launch images
"Contents.json" in "LaunchImage" asset folder and the folder DOES NOT really have launch images
Now you can have a try for localized launch images and submit the binary to iTunes Connect. In our App, the workaround did work for "localized launch images" and "submission successful".
It should be a trick for avoiding the bug in submission checking.
Since the workaround above doesn't change any resource, except making the checking thinks we use image assets, we are more convinced that there are some bugs in Apple's checking.
Cheers!
I had the same problem. You don't need launch images if running in ios 8. I made a new launch screen as a storyboard and deleted the xib version. Change the settings in Targets -> General -> Launch Screen file to reflect the new file. And make sure Targets -> Info -> UILaunchStoryboardName is updated as well.

Application rejected iOS -- Confused in naming icon files

I recently uploaded an app to app store, had all the icon files as suggested by apple but my application was rejected because of repeating "icon" files, with different dimensions but same name. Below is the problem specification:
When I add an 80X80 icon image it asks me to rename it to icon~iphone, however that image is already present with dimensions 58X58. If there are two files with same name in my app package apple rejects my app. What is the solution? I am targeting iOS 7.1.
First remove all the icon files by deleting to trash (not just delete references), now import the newly named files (like icon120, icon58, icon80 whatever you need) and click copy files with app target selected.
Now click the map icons to choose the right resources for your app icons.
The good thing about renaming the app icons is that there will be no mix up with other app icons that may linger in your xCode folder. You can now go to Build Phases and look at Copy Bundle Resources, where you can delete the old app icon files. If you can't find it, look at this screenshot (don't delete your new app icon files!):

Resources