2017-09-28 132 views
19

失踪构建所需的图标文件使用的Xcode 9和应用程序加载器:在Xcode 9

enter image description here

但你可以看到有所有需要的图标:

enter image description here

是什么案子?

这是我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! 

,它不工作在所有;(

编辑:

enter image description here enter image description here

 
Contents.json:    ASCII text 
Icon-60.png:    PNG image data, 60 x 60, 8-bit/color RGBA, non-interlaced 
[email protected]:    PNG image data, 120 x 120, 8-bit/color RGBA, non-interlaced 
[email protected]:    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 
[email protected]:    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 
[email protected]:  PNG image data, 58 x 58, 8-bit/color RGBA, non-interlaced 
[email protected]:   PNG image data, 58 x 58, 8-bit/color RGBA, non-interlaced 
[email protected]:   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 
[email protected]: PNG image data, 80 x 80, 8-bit/color RGBA, non-interlaced 
[email protected]: PNG image data, 80 x 80, 8-bit/color RGBA, non-interlaced 
[email protected]: 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 
[email protected]:  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 
+0

你能'cd'到'AppIcon.appiconset',文件夹和文件''结果粘贴到你的问题?也许某些图标偶然出现了错误的尺寸(或正确的尺寸和错误分配的“插槽”)。 –

+0

完全在黑暗中拍摄:在“AppIcon.appiconset”中显示“Icon -...”似乎有点奇怪。文件名通常以appiconset名称开头,例如:“AppIcon.appiconset” - >“[email protected]” –

+0

@MertBuran它有关系吗?这是否真的解决了这个问题? –

回答

0

正如@Daniel库塔说,解决办法是:

  1. 找到您的应用程序的xcarchive文件,
  2. 显示包内容>>产品>>应用>>您的应用名称>>显示包装内容。
  3. 从这里找到信息plist,并将BuildMachineOsBuild更改为16A323

但是,上面的解决方案将删除前三个错误,但不是最后一个警告。

5

我有同样的问题。检查:solution

正下方添加以下代码到你的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 

,然后在控制台中运行pod install

编辑:

如果它不工作,找到您的应用程序的xcarchive文件,右键单击>>显示包装内容,导航至产品>>应用程序>>您的应用程序名称>>显示包装内容。从这里找到信息plist,并将BuildMachineOsBuild更改为16A323。这基本上欺骗电脑,认为它是在一个较旧的操作系统上..问题似乎源于高塞拉利昂。然后提交应用程序。

+0

嗨,我刚刚更新了我的问题......它似乎不工作;( –

+0

我能够通过使用组合来解决此问题除了更改其他plist条目之外,我仍然收到有关营销图片的警告,但它对提交没有任何影响 –

4

确保Copy Bundle Resources在构建阶段处于[CP] Embed Pods Frameworks[CP] Copy Pods Resources之下。

enter image description here

+0

真的吗?它有什么关系吗? –

+0

只有那些对我来说没有hacky脚本的东西 – tommybananas

+0

@ tommybananas thx你救了我的一天 – LoVo

2
  • 归档项目照常
  • 在从上下文菜单中选择“在Finder中显示”
  • 组织者在从上下文菜单中选择在Finder中的存档文件最新版本“显示包内容”
  • 打开终端和CD到此文件夹
  • 在终端运行此命令:

查找产品/ -name Info.plist -print0 | xargs -0n1 plutil -replace BuildMachineOSBuild -string 16A323

然后继续定期上传。在最后,你会看到有关缺少营销图标弹出式警告,但建会经过

1

在我的情况下,其中一个豆荚有.xcassets与资源。排除此广告连播后,图标出现错误。最后,通过将.xcassets.bundle替换为固定。

.podspec更改日志的部分:

- s.resources = '**/*.xcassets' 
+ s.resources = '**/*.bundle' 
2

尝试一些上面可以除去一些错误的建议后,在我的情况,我可以通过重命名项目的.xcassets文件APPICON解决所有的人。该项目使用CocoaPods,并且其中一些包含AppIcon的示例项目。因此,不是删除这些,而是​​简单地重命名我的AppIcon并在项目设置中更改了引用。从那一刻起,它经过几个小时的反复试验才得以处理。

使用Xcode查看Pods xcassets文件时,它们缺少营销图标和iPad Pro图标定义(较旧的库)。这些都是我得到的确切的错误。在档案中,这些文件现在被命名为AppIcon,所以它们在Info.plist文件中被引用。

PS:找出如果你有多个APPICON资产,你可以使用find . -name AppIcon*

+0

我花了整整一天的时间来解决这个问题,直到我看到这个答案!我尝试了所有的建议,包括pod fix!为了解决这个问题,我重命名了我的AppIcon默认项目.xcassets文件,并更新了“资产目录应用程序图标集名称”以与此新值对齐。最后可以看到我的美丽ico ns在主屏幕上。 – ack