【发布时间】:2017-10-02 15:52:13
【问题描述】:
场景:
- Xcode 9 和 iOS 11 SDK。
- Cocoapods 版本 1.3.1
- 具有多个目标的项目
当我在装有 iOS 11 的模拟器或设备上运行我的应用程序时,应用程序图标接缝就像未设置一样,但当然它是在 Assets.xcassets -> AppIcon.appiconset 中设置的,并且在 iOS
有人可以帮我解决这个问题吗? 谢谢。
【问题讨论】:
场景:
当我在装有 iOS 11 的模拟器或设备上运行我的应用程序时,应用程序图标接缝就像未设置一样,但当然它是在 Assets.xcassets -> AppIcon.appiconset 中设置的,并且在 iOS
有人可以帮我解决这个问题吗? 谢谢。
【问题讨论】:
他们在新的 XCode 中增加了一个应用程序图标大小,尝试添加该分辨率,然后检查一下。我认为是 1024*1024。
【讨论】:
我在我的项目中遇到了同样的问题...... 我已经尝试了很多方法来解决它...... 最后我像这样为我解决了它----
我remove来自Assets.xcassets -> AppIcon.appiconset的所有图标
之后从X-code menu bar 选择Product-->Clean
和delete 来自Simulator 的应用程序..
再次添加Assets.xcassets -> AppIcon.appiconset中的所有图标
运行它,,屏幕上会显示图标...希望它会对您有所帮助。
【讨论】:
解决方案 在 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
【讨论】: