2017-09-28 131 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