Xcode9 Icon不显示

今天更新了Xcode9 听说有坑 跑了下项目 APP icon 变成了下图

image.png
莫名的懵逼 ,检查了下配置没问题 只好谷歌得到解决方法两个
链接地址:https://github.com/CocoaPods/CocoaPods/issues/7003
https://github.com/mythkiven/developTips

使用了CocoaPods的Xcode工程,在iOS11版的手机上AppIcon不显示,原因是CocoaPods的资源编译脚本在iOS11下出了点问题.需要修改脚本.两种修改方式:
1.在Podfile添加脚本修改:

1). 在Podfile 添加如下代码.

post_install do |installer|
copy_pods_resources_path = “Pods/Target Support Files/Pods-[工程名]/Pods-[工程名]-resources.sh”
string_to_replace = ‘–compile “ BUILTPRODUCTSDIR/ {UNLOCALIZED_RESOURCES_FOLDER_PATH}”’
assets_compile_with_app_icon_arguments = ‘–compile “ BUILTPRODUCTSDIR/ {UNLOCALIZED_RESOURCES_FOLDER_PATH}” –app-icon “ ASSETCATALOGCOMPILERAPPICONNAME"outputpartialinfoplist" {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
需要注意的是,将[工程名] 换成自己工程的名称

2).然后运行

$pod install
2.手动修改
打开工程目录下:[工程名]/Pods/Target Support Files/Pods-[工程名]/Pods-[工程名]-resources.sh这个文件,替换最后一段代码:

修改前:

printf “%s\0” “ XCASSETFILES[@]"|xargs0xcrunactooloutputformathumanreadabletextnoticeswarningsplatform" {PLATFORM_NAME}” –minimum-deployment-target “ !DEPLOYMENTTARGETSETTINGNAME" {TARGET_DEVICE_ARGS} –compress-pngs –compile “ BUILTPRODUCTSDIR/ {UNLOCALIZED_RESOURCES_FOLDER_PATH}”
fi
修改后:

printf “%s\0” “ XCASSETFILES[@]"|xargs0xcrunactooloutputformathumanreadabletextnoticeswarningsplatform" {PLATFORM_NAME}” –minimum-deployment-target “ !DEPLOYMENTTARGETSETTINGNAME" {TARGET_DEVICE_ARGS} –compress-pngs –compile “ BUILTPRODUCTSDIR/ {UNLOCALIZED_RESOURCES_FOLDER_PATH}” –app-icon “ ASSETCATALOGCOMPILERAPPICONNAME"outputpartialinfoplist" {BUILD_DIR}/assetcatalog_generated_info.plist”
fi
然后重新运行工程即可
我用的第二种 完美解决 继续踩坑去。。

你可能感兴趣的:(IOS开发)