Failed to read file attributes for Images.xcassets in Xcode 9

我们两清 提交于 2019-11-30 11:11:28

Removing the reference of Images.xcassets and adding it again in Project resolved the error.

It fixes for me by update to latest Cocoapods:

sudo gem install cocoapods --pre

I did face the same errors what you've but I just fixed it following ways-

  1. Delete the project's derived data
  2. Exit Xcode and open it again

Check your "Full path" in inspector and path in Finder, probably they are different. I also had this issue. on my pc was ../Development/MyProject/.. and ../development/MyProject/.. so in that was problem

I believe it is related to bug of cocoapods causes compilation error. To solve this, you can try add this to your podfile to the bottom level :

Change the target name according to your target name

post_install do |installer|

copy_pods_resources_path = "Pods/Target Support Files/Pods-XXXTARGETNAMEXXX/Pods-XXXTARGETNAMEXXX-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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!