欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

iOS 11 AppIcon不显示问题小结

程序员文章站 2023-12-20 15:22:22
今天更新xcode 9 后,在运行老项目时遇到一个小坑,就是无论如何都不显示appicon,在网络上找到了方法,单并没有解决,其实不是方法的问题,只是有一个小细节要注意,在...

今天更新xcode 9 后,在运行老项目时遇到一个小坑,就是无论如何都不显示appicon,在网络上找到了方法,单并没有解决,其实不是方法的问题,只是有一个小细节要注意,在这里提示一下.

出现这个问题的原因就是cocoapods与ios 11出现点问题,这里你要更新你的cocoapods至最新版本.然后在你的podfile文件中添加如下代码.这里一定要注意,要在end下面,如图所示

代码:

post_install do |installer|
copy_pods_resources_path = "pods/target support files/pods-fuelcardapp/pods-fuelcardapp-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

iOS 11 AppIcon不显示问题小结

总结

以上所述是小编给大家介绍的ios 11 appicon不显示问题的解决方法,希望对大家有所帮助

上一篇:

下一篇: