iOS11中AppIcon设置无效的问题
2017-11-28 08:57
375 查看
原文地址:https://github.com/mythkiven/developTips
使用了CocoaPods的Xcode工程,在iOS11版的手机上AppIcon不显示,原因是CocoaPods的资源编译脚本在iOS11下出了点问题.需要修改脚本.两种修改方式:
1.在Podfile添加脚本修改:
1). 在Podfile 添加如下代码.
需要注意的是,将
2).然后运行
2.手动修改
打开工程目录下:
修改前:
修改后:
然后重新运行工程即可
解决方案源于这哥们
本地环境是:Xcode9(GM)+iOS11手机+pod1.2.0
原文地址: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 "${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
需要注意的是,将
[工程名]换成自己工程的名称
2).然后运行
$pod install
2.手动修改
打开工程目录下:
[工程名]/Pods/Target Support Files/Pods-[工程名]/Pods-[工程名]-resources.sh这个文件,替换最后一段代码:
修改前:
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" fi
修改后:
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${BUILD_DIR}/assetcatalog_generated_info.plist" fi
然后重新运行工程即可
解决方案源于这哥们
本地环境是:Xcode9(GM)+iOS11手机+pod1.2.0
原文地址:https://github.com/mythkiven/developTips
相关文章推荐
- AppIcon设置无效
- 项目中的AppIcon设置问题
- iOS11中navigationBar上 按钮图片设置frame无效 不受约束 产生错位问题 解决
- iOS11 设置tableview的header或者footer高度无效的问题
- 在设置app icon时的问题
- Android 关于android:foreground设置无效的问题
- 解决串口通讯中部分串口ReadFile使用SetCommTimeouts设置超时无效的问题
- 今天遇到一问题,ios 应用 App 的Icon 变白问题。
- cocos2d-x在android真机上设置帧率无效的问题
- AppICon设置
- iOS app启动图片及icon图片及应用名设置
- 解决安卓windowAnimationStyle 设置退出动画无效或者被干扰的问题
- iOS App设置icon,启动图,App名称的方法
- html5 span设置宽度无效的问题
- Android H5微信支付 webview设置referer 请求头无效问题解释和详细处理方案
- 关于ToolStrip设置Location无效的问题
- 44.iOS 启动页面设置和 AppIcon设置
- iOS App设置icon,启动图,App名称的方法【原创】
- thinkphp设置session无效的问题
- cmdecho和nomutt设置无效的问题(未解决)