Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App Icon missing iOS 11

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.

like image 430
Saqib Omer Avatar asked Nov 29 '22 06:11

Saqib Omer


1 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.

like image 106
VitGur Avatar answered Dec 09 '22 09:12

VitGur