【www.bbyears.com--今天更新】
今天更新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
word-spacing:0px;text-transform:none;font-weight:normal;color:#333333;padding:0px;font-style:normal;text-align:left;margin:0px;letter-spacing:normal;background-color:#FFFFFF;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;width:650px;height:auto;" alt="" />