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

后端 未结 5 1641
萌比男神i
萌比男神i 2021-01-01 17:37

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 r

相关标签:
5条回答
  • 2021-01-01 18:04

    It fixes for me by update to latest Cocoapods:

    sudo gem install cocoapods --pre
    
    0 讨论(0)
  • 2021-01-01 18:05

    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

    0 讨论(0)
  • 2021-01-01 18:06

    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
    0 讨论(0)
  • 2021-01-01 18:11

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

    0 讨论(0)
  • 2021-01-01 18:25

    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

    0 讨论(0)
提交回复
热议问题