从 Xcode 9 构建中缺少所需的图标文件 [英] Missing required icon files in build from Xcode 9
本文介绍了从 Xcode 9 构建中缺少所需的图标文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用 Xcode 9 和应用程序加载器:
但是正如您所看到的,这里有所有必需的图标:
这是怎么回事?
这是我的 podfile:
<前>使用_框架!来源'https://github.com/CocoaPods/Specs.git'定义豆荚豆荚谷歌地图"吊舱选择器视图"吊舱'SWNavigationController'豆荚分支"pod 'JTAppleCalendar', :git => 'https://github.com/patchthecode/JTAppleCalendar.git', :branch => 'master'pod 'SVProgressHUD'结尾defuniversal_pods吊舱'AFNetworking'pod 'Crashlytics'豆荚织物"pod 'MagicalRecord'结尾目标FieldService"做豆荚Universal_pods结尾目标FieldServiceTests"做豆荚Universal_pods结尾目标FieldServiceTodayTimer"做Universal_pods结尾目标FieldServiceTodayCurrent"做Universal_pods结尾post_install 做 |安装程序|copy_pods_resources_path = "Pods/目标支持文件/Pods-FieldService/Pods-FieldService-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_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"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 }结尾禁止所有警告!它根本不起作用;(
<前>Contents.json:ASCII 文本Icon-60.png:PNG 图像数据,60 x 60,8 位/彩色 RGBA,非隔行Icon-60@2x.png:PNG 图像数据,120 x 120,8 位/彩色 RGBA,非隔行Icon-60@3x.png:PNG 图像数据,180 x 180,8 位/彩色 RGBA,非隔行Icon-76.png:PNG 图像数据,76 x 76,8 位/彩色 RGBA,非隔行Icon-76@2x.png:PNG 图像数据,152 x 152,8 位/彩色 RGBA,非隔行Icon-Small.png:PNG 图像数据,29 x 29,8 位/彩色 RGBA,非隔行Icon-Small@2x-1.png:PNG 图像数据,58 x 58,8 位/彩色 RGBA,非隔行Icon-Small@2x.png:PNG 图像数据,58 x 58,8 位/彩色 RGBA,非隔行Icon-Small@3x.png:PNG 图像数据,87 x 87,8 位/彩色 RGBA,非隔行Icon-Spotlight-40.png:PNG 图像数据,40 x 40,8 位/彩色 RGBA,非隔行Icon-Spotlight-40@2x-1.png:PNG 图像数据,80 x 80,8 位/彩色 RGBA,非隔行Icon-Spotlight-40@2x.png:PNG 图像数据,80 x 80,8 位/彩色 RGBA,非隔行Icon-Spotlight-40@3x.png:PNG 图像数据,120 x 120,8 位/彩色 RGBA,非隔行Icon-Spotlight-41.png:PNG 图像数据,40 x 40,8 位/彩色 RGBA,非隔行Icon-Spotlight-42.png:PNG 图像数据,40 x 40,8 位/彩色 RGBA,非隔行Icon-Spotlight-43.png:PNG 图像数据,20 x 20,8 位/彩色 RGBA,非隔行Icon-iPadPro@2x.png:PNG 图像数据,167 x 167,8 位/彩色 RGBA,非隔行fieldservice.png:PNG 图像数据,1024 x 1024,8 位/彩色 RGBA,非隔行
解决方案
正如@Daniel Kuta 所说,解决方案是:
- 找到您应用的 xcarchive 文件,
- 显示包内容 >> 产品 >> 应用程序 >> 您的应用程序名称 >> 显示包内容.
- 从此处找到信息 plist,并将 BuildMachineOsBuild 更改为 16A323.
然而,上述解决方案将消除前三个错误,但不会消除最后一个警告.
Using Xcode 9 and Application Loader:
But as you can see there are all required icons:
What is the case?
This is my podfile:
use_frameworks! source 'https://github.com/CocoaPods/Specs.git' def pods pod 'GoogleMaps' pod 'PickerView' pod 'SWNavigationController' pod 'Branch' pod 'JTAppleCalendar', :git => 'https://github.com/patchthecode/JTAppleCalendar.git', :branch => 'master' pod 'SVProgressHUD' end def universal_pods pod 'AFNetworking' pod 'Crashlytics' pod 'Fabric' pod 'MagicalRecord' end target 'FieldService' do pods universal_pods end target 'FieldServiceTests' do pods universal_pods end target 'FieldServiceTodayTimer' do universal_pods end target 'FieldServiceTodayCurrent' do universal_pods end post_install do |installer| copy_pods_resources_path = "Pods/Target Support Files/Pods-FieldService/Pods-FieldService-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 inhibit_all_warnings!
and it doesnt work at all;(
EDIT:
Contents.json: ASCII text Icon-60.png: PNG image data, 60 x 60, 8-bit/color RGBA, non-interlaced Icon-60@2x.png: PNG image data, 120 x 120, 8-bit/color RGBA, non-interlaced Icon-60@3x.png: PNG image data, 180 x 180, 8-bit/color RGBA, non-interlaced Icon-76.png: PNG image data, 76 x 76, 8-bit/color RGBA, non-interlaced Icon-76@2x.png: PNG image data, 152 x 152, 8-bit/color RGBA, non-interlaced Icon-Small.png: PNG image data, 29 x 29, 8-bit/color RGBA, non-interlaced Icon-Small@2x-1.png: PNG image data, 58 x 58, 8-bit/color RGBA, non-interlaced Icon-Small@2x.png: PNG image data, 58 x 58, 8-bit/color RGBA, non-interlaced Icon-Small@3x.png: PNG image data, 87 x 87, 8-bit/color RGBA, non-interlaced Icon-Spotlight-40.png: PNG image data, 40 x 40, 8-bit/color RGBA, non-interlaced Icon-Spotlight-40@2x-1.png: PNG image data, 80 x 80, 8-bit/color RGBA, non-interlaced Icon-Spotlight-40@2x.png: PNG image data, 80 x 80, 8-bit/color RGBA, non-interlaced Icon-Spotlight-40@3x.png: PNG image data, 120 x 120, 8-bit/color RGBA, non-interlaced Icon-Spotlight-41.png: PNG image data, 40 x 40, 8-bit/color RGBA, non-interlaced Icon-Spotlight-42.png: PNG image data, 40 x 40, 8-bit/color RGBA, non-interlaced Icon-Spotlight-43.png: PNG image data, 20 x 20, 8-bit/color RGBA, non-interlaced Icon-iPadPro@2x.png: PNG image data, 167 x 167, 8-bit/color RGBA, non-interlaced fieldservice.png: PNG image data, 1024 x 1024, 8-bit/color RGBA, non-interlaced
解决方案
As @Daniel Kuta said the solution is:
- locate your app's xcarchive file,
- show package contents >> products >> applications >> your application's name >> show package contents.
- Locate the info plist from here, and change the BuildMachineOsBuild to 16A323.
However above solution will remove first three errors, but not the last one warning.
这篇关于从 Xcode 9 构建中缺少所需的图标文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文