How to resolve Failed to read file attributes for /Users/path/myapp/Images.xcassets in Xcode?
I found out that my folder name is images.Xcassets
, which Group name and Full Path is Images.xcassets
. You should check your group name and full path in File inspector.
EDIT:
Here are two solutions:
1. Remove the group from Project Navigator (ALT+1), and add files back again (OPTION+ALT+A).
2. Click the folder icon from File Inspector (OPTION+ALT+1) and choose a new folder.
Create file reference to image in Images.xcassets using xcodeproj
It turns out Xcode handles the image references for you if you add an .xcassets
file to your project.
Another thing I learned is that the .xcassets
folder should be added to your target(s) as a resource with xcodeproj
instead of a file reference. That way it will correctly show up under Project -> Target -> Build Phases -> Copy Bundle Resources
.
e.g. target.add_resources([file_reference_to_xcassets])
instead of target.add_file_references([file_reference_to_xcassets])
Hopefully, this helps someone down the road :)
Related Topics
How Detect Swipe Gesture Direction
Calculate All Permutations of a String in Swift
Having App Restart Itself When It Detects Change to Privacy Settings
How to Stop Symbolicate Adding "<Redacted>" Pieces to iOS Crash Log
Avfoundation Image Orientation Off by 90 Degrees in the Preview But Fine in Camera Roll
iOS Tableview Reload and Scroll Top
Uitextview Adding New Line Unintentionally
Nsgenericexception Reason Collection <Nsconcretemaptable: Xxx>
iOS 11 Uibarbuttonitem Images Not Sizing
Adding Quartzcore to Xcode 4 for iOS
How to Change the Speed of Video Playback
iOS Name of This Way of Building and Returning an Object in Objective-C
Distanceinmeters Problems with Arrays and Sort
Proper Usage of Intrinsiccontentsize and Sizethatfits: on Uiview Subclass with Autolayout