作者:手机用户2602911885 | 来源:互联网 | 2023-01-16 17:48
更新到Xcode 9(9A235)后,在iOS 11上运行后,app图标丢失.它在以前的版本中工作正常.此问题是由CocoaPods引起的.我试过这个解决方案,但这给了我错误.
处理Podfile的安装后挂钩时发生错误.
VitGur..
11
尝试在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
您可以在此处找到有关此问题的更多信息.
1> VitGur..:
尝试在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
您可以在此处找到有关此问题的更多信息.
2> Aakash Aggar..:
问题:
1.应用程序图标未出现在iOS 11或Xcode 9上.
2.应用程序图标在iPhone上可见但在iPad上不可见.
对我有用的解决方案:
此问题通常可以解决在Xcode 7上或之前制作的应用程序的问题.
问题似乎在于Xcode 9和iOS 11的构建过程.过去,Apple一直在使用~iPad扩展来区分iPhone和iPad的资产.
info.plist有一个字典,其密钥为" CFBundleIcons~ipad ",没有任何项目(如Xcode 9中所示),这导致bundle从info.plist文件而不是images.xcassets中获取图像,因此Xcode 9上的应用程序图标未显示.
从.plist文件中删除此密钥对我的构建工作,而其他人没有.
![删除标题为](https://img.php1.cn/3cd4a/1eebe/cd5/a5d7215df572c386.webp)