简体   繁体   中英

Issue with icons in iOS 11 using cocoapods

Scenario:

  • Xcode 9 and iOS 11 SDK.
  • Cocoapods version 1.3.1
  • Project with multiple targets

When I run my app on simulator or device with iOS 11 the app icon seams like unset, but of course it was setted in Assets.xcassets -> AppIcon.appiconset and works perfectly in iOS<=10.3.3.

这是结果

Can someone help me with this issue? Thanks.

They added one more app icon size in new XCode, try to add that resolution and then check it out. I think it is 1024*1024.

I was faced the same issue in my Project ... I have tried so many ways to solve it .... Finally I solved it for me like this ----

I remove all the iCon from Assets.xcassets -> AppIcon.appiconset After that from X-code menu bar selecte Product-->Clean And delete the app from Simulator ..

Again add the all the iCon in Assets.xcassets -> AppIcon.appiconset Run it ,,, and iCon is showing on the screen ... May it will help you.

SOLUTION Add this script at bottom of 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM