Skip to content

Instantly share code, notes, and snippets.

@crespoxiao
Created September 22, 2017 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crespoxiao/fbd900cf537229fdcf736dfa377d5c7b to your computer and use it in GitHub Desktop.
Save crespoxiao/fbd900cf537229fdcf736dfa377d5c7b to your computer and use it in GitHub Desktop.
fix App Icons not included in build from Xcode 9 With CocoaPods
post_install do |installer|
copy_pods_resources_path = "Pods/Target Support Files/Pods-XXX/Pods-XXX-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
put the code in podfile, replace copy_pods_resources_path with your project, then run pod install and build trarget.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment