Failed to read file attributes for Images.xcassets

2019-02-08 02:38发布

问题:

I have old project that is running in Xcode 8 fine but when i am trying to run the project in Xcode 9 beta version I am getting the error

Failed to read file attributes for Images.xcassets

回答1:

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



回答2:

It fixes for me by update to latest Cocoapods:

sudo gem install cocoapods --pre


回答3:

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


回答4:

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



回答5:

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