App Icon missing iOS 11

Viewed 4333

After updating to Xcode 9 (9A235), app icon was missing after running on iOS 11. It was working fine in previous version. This issue is caused by CocoaPods. I have tried this solution but this is giving me error.

An error occurred while processing the post-install hook of the Podfile.

4 Answers

Try adding this script in your podfile.

post_install do |installer|
    installer.aggregate_targets.each do |target|
        copy_pods_resources_path = "Pods/Target Support Files/#{target.name}/#{target.name}-resources.sh"
        string_to_replace = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"'
        assets_compile_with_app_icon_arguments = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${BUILD_DIR}/assetcatalog_generated_info.plist"'
        text = File.read(copy_pods_resources_path)
        new_contents = text.gsub(string_to_replace, assets_compile_with_app_icon_arguments)
        File.open(copy_pods_resources_path, "w") {|file| file.puts new_contents }
    end
end

More information about this issue you can find here.

After trying every option from above, to no avail, I checked the "Asset Catalog App Icon Set Name" in my Build Settings in Xcode, and I noticed it was empty. So I simply set this to "AppIcon" (or whatever your app icon set is named in the asset catalog) and it worked immediately.

Note: if you have your Build Settings set to "Basic" or "Customized" this setting may not show up. As a result, set it to "All"

Have a look at my solution here: https://stackoverflow.com/a/48209677/391605

Basically, it seems like, with Xcode 9.x, there are extra icons in the Image Sets, especially for iPads. If you create yourself a "New iOS App Icon", and tell Xcode to use that as your app's icon, it fixes this issue.

enter image description here

Related