Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
6
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

posted at

updated at

Organization

iOS11 xcode9でビルドすると、デフォルトアイコンになってしまう。または申請時に Missing required icon file. と怒られる場合

  • xcode9でビルドしたアプリはなぜかデフォルトの、白背景に幾何学模様のアイコンになってしまう

  • 申請しようとすると Missing required icon file. と怒られた

これらの現象に遭遇した場合は cocoapods が怪しい

対応策

post_install do |installer|
    copy_pods_resources_path = "Pods/Target Support Files/Pods-(アプリのTARGET名)/Pods-(アプリのTARGET名)-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

これを Podfile に追加して、

pod install

を再実行。

以上で解決します

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
6
Help us understand the problem. What are the problem?