缺少应用程序图标 iOS 11
App Icon missing iOS 11
更新到 Xcode 9 (9A235) 后,应用程序图标在 iOS 11 运行 之后丢失。它在以前的版本中运行良好。此问题是由 CocoaPods. I have tried this 解决方案引起的,但这给了我错误。
An error occurred while processing the post-install hook of the 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
有关此问题的更多信息,请参阅 here。
在尝试了上面的每一个选项后,都无济于事,我在我的 Build Settings in Xcode,我注意到它是空的。所以我只是将其设置为 "AppIcon"(或者您的应用程序图标集在资产目录中命名的任何名称)并且它立即起作用。
注意:如果您将 Build Settings 设置为 "Basic" 或 "Customized",此设置可能不会显示。结果,将其设置为“All”
问题:
1.应用程序图标未出现在 iOS 11 或 Xcode 9.
2。应用程序图标在 iPhone 上可见,但在 iPad.
上不可见
对我有用的解决方案:
此问题通常可以解决 Xcode 7 日或之前制作的应用程序的问题。
问题似乎与 Xcode 9 和 iOS 11 的构建过程有关。过去,Apple 一直使用 ~iPad 扩展来区分资产iPhone 和 iPad.
info.plist 有一个键为“CFBundleIcons~ipad”的字典,它没有任何项目(如 Xcode 中所示9),这导致捆绑包从 info.plist 文件而不是 images.xcassets 获取图像,因此 Xcode 9 上的应用程序图标没有出现。
从 .plist 文件中删除这个密钥对我的构建有效,而其他的则没有。
在这里查看我的解决方案:
基本上,Xcode 9.x,图像集中似乎有额外的图标,尤其是 iPad。如果您自己创建一个 "New iOS App Icon",并告诉 Xcode 将其用作您应用程序的图标,则可以解决此问题。
更新到 Xcode 9 (9A235) 后,应用程序图标在 iOS 11 运行 之后丢失。它在以前的版本中运行良好。此问题是由 CocoaPods. I have tried this 解决方案引起的,但这给了我错误。
An error occurred while processing the post-install hook of the 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
有关此问题的更多信息,请参阅 here。
在尝试了上面的每一个选项后,都无济于事,我在我的 Build Settings in Xcode,我注意到它是空的。所以我只是将其设置为 "AppIcon"(或者您的应用程序图标集在资产目录中命名的任何名称)并且它立即起作用。
注意:如果您将 Build Settings 设置为 "Basic" 或 "Customized",此设置可能不会显示。结果,将其设置为“All”
问题:
1.应用程序图标未出现在 iOS 11 或 Xcode 9.
2。应用程序图标在 iPhone 上可见,但在 iPad.
上不可见对我有用的解决方案:
此问题通常可以解决 Xcode 7 日或之前制作的应用程序的问题。
问题似乎与 Xcode 9 和 iOS 11 的构建过程有关。过去,Apple 一直使用 ~iPad 扩展来区分资产iPhone 和 iPad.
info.plist 有一个键为“CFBundleIcons~ipad”的字典,它没有任何项目(如 Xcode 中所示9),这导致捆绑包从 info.plist 文件而不是 images.xcassets 获取图像,因此 Xcode 9 上的应用程序图标没有出现。
从 .plist 文件中删除这个密钥对我的构建有效,而其他的则没有。
在这里查看我的解决方案:
基本上,Xcode 9.x,图像集中似乎有额外的图标,尤其是 iPad。如果您自己创建一个 "New iOS App Icon",并告诉 Xcode 将其用作您应用程序的图标,则可以解决此问题。