The folder "Images.xcassets" doesn't exist - ios

When I open the project file in the latest xcode version, I get the error "The folder "Images.xcassets" doesn't exist" in two popups. I have to click OK multiple times to make the popups disappear. I haven't done anything to remove such folders. Does anyone have an idea why I might be getting them?
Update:
I see it in finder and in my project explorer too. The problem still persists.

I used the hotkey combinations for Cleaning the Project and Cleaning the Build Folder. Building again after this did the trick. The problem came up after merging too Git Repository Branches of our Project and trying to build.
Clean Build Folder:
Option + Shift+ Command + K
Clean Project:
Shift + Command + K

You have probably set your launch images to be extracted from an asset catalog (which is 'images.xcassets' by default). If you don't want to use asset catalogs, go to your application settings and select 'don't use asset catalogs', but, if you do (I recommend you do use asset catalogs for App Icons and Launch Images), click 'create asset catalog'. If that option isn't available, right click on your project, select 'New File', go to 'Resource', and select Asset Catalog.

I have been plagued by this problem over the past month or two. It didn't hurt anything – it was just annoying. The problem exhibited itself in both Xcode's 6.4 and 7.
I finally fixed it today by inserting the following lines into our project's info.plist:
<key>CFBundleIcons</key>
<dict/>
<key>CFBundleIcons~ipad</key>
<dict/>
Actually what I did was from the project settings' General pane under App Icons and Launch Images, I changed the App Icons Source from my asset catalog to "Don't use asset catalogs" and then changed it back to "Use Asset Catalog". Xcode then modified my asset catalog by inserting a 2nd entry for AppIcon, but I just rolled that change back using my git client. The change to the info.plist (shown above) I left in place, and this solved the issue for me.

I solved a similar issue by doing this:
Remove the Images.xcassets folder from your project.
Close Xcode and open .xcodeproj using VSCode or similar tool.
In VSCode, find every reference to Images.xcassets and remove the line. Save the file and open Xcode. Then add Images.xcassets back to your project.

Exact situation happened for me.
The thing is that , i have added second target unknowingly.
Deleting all the files related to that second target , solved the issue.

Set the 'App icons source' and 'Launch Images Source' to 'Don't use asset catalogs', switch to other file then switch back, the popups will disappear.
Reset the 'App icons source' and 'Launch Images Source'.

Add Image. Imageset folder in your project, in Assets.xcassets director.

Related

iOS My application.xcodeproj causes and display red text, Then I unable to open project?

I have facing this issue when I was changing project name and copying my project from one mac to another. There are some red texts indicate the missing files from the project source codes(But I have all files in Project folder) I have used cocoapods in this project. How to avoid these?
Here I have shown my project screen shot.
As per your description... you must be having some issue in your project.pbxproj file. Please check that file. Common issue happens in that file when you try to merge different branches having conflicts in project structure.
There could be different reasons of this:
It may happen because the xcode is open and the source folder is not available.
It may happen when source path is not found in your system and xcode shows that.
For resolving this, quiet xcode and reopen your source from .xcodeproj again, will resolve the problem.
Click on the file, then on the far top right of Xcode look under Identity and Type Check and see if the path to the file is correct. In my case is was not so I had to click on the small folder icon (not the arrow icon) and select the folder in finder.

How to resolve Failed to read file attributes for "/Users/path/myapp/Images.xcassets" in Xcode?

Suddenly I am getting error in Xcode 9 beta like
"Failed to read file attributes for "/Users/path/myapp/Images.xcassets" in Xcode?" and unable to build as well I just dragged the "Images.Xcassets" folder to up that's it.
I checked targets, Copy Bundle Resources and "Images.Xcassets" folder existed. But, I am unable to build the project.
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.
It's an issue of latest Xcode9. There are two ways to solve this issue.
Follow these:
Remove reference the images.Xcassets file from your project. Once you remove it from project and add to project again solved my problem.
If option 1 don't work, delete(Trash) the full images.Xcassets file and add all icon again.
Make sure you add this in your icon name Build settings.
"Quit the Xcode and restart." it worked out for me. I got the same problem with Xcode-9.0. I have tried it in multiple ways like deleting Derived data, Cleaning the project and closing the Xcode but nothing worked.
Delete your derived data and then Quit X code
Cmd+q quit the xcode and open it again.
I had this same problem though, using local pods. It seems that xcodebuild is now case sensitive relative to the resource path.
~/Folder/MyProject != ~/folder/MyProject
Closing and reopening Xcode fixed the problem for me

/Products/Debug-iphoneos/: No such file or directory Xcode 8 [duplicate]

Xcode keeps prompting telling me I don't have a certain image in the project and it errors when I try to build. If I deleted the .png Xcode is complaining about from the project, why does Xcode error out when I try to build?
[Edited by Rhubarb (got too big for the comments)]
I'm getting the same thing with these details. The copy command looks like this
CpResource MyIcons/../13-bicycle.png /Users/Me/Library/Developer/Xcode/DerivedData/MyProject-cxsohyxdecdbptgrrtaixbhhixrj/Build/Products/Debug-iphonesimulator/MyProject.app/13-bicycle.png
then there's a bunch of setenv and the command is translated to "builtin-copy" but none of that matters, the result is when I compile I get this error:
error: /Users/Me/Development/MyProject/MyIcons/../13-bicycle.png: No such file or directory
Now, I opened the Copy Bundle Resources tab as suggested by Robert Harvey, and my .png is there, with nothing appearing in read. And it is in the file system (Finder) and in the Project Navigator. So I deleted it from the resources using the - button and added it manually using the + button at the bottom left of the list in the Copy Bundle Resources tab. This put it at the root of the project in the Navigator, so I moved it into my group again - but no luck, same error. So I just deleted it altogether (from the Project Navigator, allowing it to be moved to Trash). That worked, but I ran into the same error with the very next icon (it only reports one or two at a time).
Looking at the error message, it appears to think that MyIcons is a folder. It's not, it's just a group. There is no such folder, I can see in the file system.
When I added via drag-drop, I left the "Copy items into ... group folder (if needed)" checked and the "Create groups for any added folders" button selected. But note that I only dragged icons (en masse) into an existing group; I did not drag over any folders, nor where any groups or folders created. But somehow, the compiler thinks that these resources are in a folder in the file system that doesn't exist.
I right clicked the icon in the Copy Resources List and tried both Show in Finder and Reveal in Project Navigator: and both worked - the file is there and it knows where to get it - until it builds.
I haven't even found a workaround beyond deleting the icons yet - cleaning doesn't work. I think my group is corrupted.
look up here XCode Build – CopyPNGFile Error and No Such File or Directory .
I had same problem and this solution helps me.
If you receive either of these annoying errors when building your
xcode app, something has corrupted in your project bundle.
Open your project in Xcode
Click on your project
Click on your project under Targets
Hit the build phases tab
Open “Copy Bundle Resources” near the bottom
Look for any resources listed in red!
I had the same problem but my solution was a bit different:
Open project in Xcode
Open project navigator
In the filter down below, search for your erroneous file name
I found the file under a group called "Recovered References" and it was marked in red
Delete the red files and everything should work perfectly
Okay here's the unsatisfactory workaround that fixed it for me.
(First, note that when I right-clicked my dodgy Group in the Project Navigator) it looked like any other group except that Open in External Editor was greyed - weird eh?)
I closed XCode and restarted it.
=> Now I see all of the icons under the offending group are red (in the Project Navigator)
Delete the entire group.
Create a new group (same name) and drag-drop the icons from the original source into the group
=> Error failed to copy (or some such - I can't remember but I have seen and fixed this before - and seen it elsewhere on SO)
This error is due to leftover icons, so to fix this one now,
I deleted all other groups with icons and moved their icons to trash
open finder at the project location
delete every icon in the project (sort by kind, delete all the .png)
make a new group again, and drag all the icons in _again.
whew, now hit Builder
=> XCode crashes.
Lovely.
Restart Xcode
fingers crossed: Build
=> it works. Brief celebration and back to work.
(See what I mean about unsatisfactory)
perhaps you move the file named **-Prefix.pch,you can change the dictionary of the file ,do like this : the error about “no such file or directory”
Check your project file paths. If there is a space in any of the folders, it causes this error. Simply remove spaces.
Using XCode 10, I got this error after deleting some files I no longer needed in my project.
In my case, I went to XCode, clicked on the project name, then under Resources, the missing files were listed in red. All I did was to delete them.
In case you need the files, you will need to add them by going to File ->Add files to , then select the files. After selecting the file, make sure you have Copy files if needed checked.
Hope that helps someone.
HappyCoding
try set target CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS=NO
XCode Build – CopyPNGFile Error and No Such File or Directory
If you receive either of these annoying errors when building your xcode app, something has corrupted in your project bundle.
Open your project in Xcode
Click on your project
Click on your project under Targets
Hit the build phases tab
Open “Copy Bundle Resources” near the bottom
Look for any resources listed in red!

Accidentally removed xcassets file from Xcode project

I wanted to remove a single folder from the image collection, however, I somehow managed to throw the entire xcassets file into the trash.
The normal 'Put back' method is not available, and simply dragging the deleted folder to Xcode yields an error:
"Images.xcassets" couldn't be copied to "ProjectPear" because an item with the same name already exists.
To save the file, either provide a different name, or move aside or
delete the existing file, and try again.
I'm not sure where this collection is located within my Xcode project, as the navigator doesn't appear to show anything, and the command-line isn't dropping any hints either. I'm afraid to mess around with the project.pbxproj file, as it might jumble up a lot more than just my image collection.
Edit:
Dragging the files back to Finder from Trash was successful, however, the Xcode navigator no longer recognises - or in this case, still doesn't recognise - the .xcassets file. I'm not sure whether to add something in the .pbxproj file.
I just did this myself and figured out how to quickly remedy the issue.
Go to the project folder in the Finder. You should find that the
folder Images.xcassets is still there.
Move it to a separate location like to the Desktop or something. It
still has all of the images and json files.
Jump back to Xcode and create a new asset catalog for images.
File > New > File... > Resource > Asset Catalog
Name it Images.
Quit Xcode and return to the Finder.
Copy the folders from within your old Images.xcassets to the new
Images.xcassets directory in your project.
Launch Xcode and you're back in business!
If you didn't delete it completely, you can just drag it back in from Finder. (Right click your project and select 'Reveal in Finder' to check)
If it's gone completely you simply go Cmd+N -> Resource and select Asset Catalog. You then re-add your imagages via drag and drop or right-click and 'Add Files to ...' and should be good to go.
Hope that helps.
Usually the file's reference is removed from Xcode, the original folder still exists in the project directory.
Right-click on your project folder, click "Add files to "your project"", find Assets in your project and click Add and you're
done
Had the same problem today with Xcode Beta, I also couldn't create a new assets catalog for some reason.
This was on a Watchkit Extension Project
Here's what I did to solve it:
In finder I copied an existing images.xcassets from another folder in my app to my desktop.
Removed the content of this folder.
Copied a deleted (single) Image Asset from my trash into the folder (on my desktop).
Dragged the entire folder into my project in XCode.
That fixed it and everything went back to normal.
If you have deleted it completely, then also these are the steps to get a new Images.xcassets:
In the Navigator, click on the project.
Go to : File>New>File> Add Asset Catalog> Name it.
To add AppIcon and LaunchImage in it:
Go to the Project Setting:
In General Tab, Slide down to App Icons and Launch Images
Click option next to App Icons Source and select Use Asset Catalogs
A window will pop up- select the name of your new Images.xcassets file and click on Migrate.
Select Also add LaunchImage. Now you can see the new Images.xcassets in your project :).
I accidentally deleted the reference to the asset folder so that it was no longer visible in Xcode. But when I checked from the finder, the asset folder was still in the project folder.
If you did that, just open the file menu in Xcode (from within your current project) and at the very top you can add (existing) files to that very project (back again) - it says "Add files to..."
Right click on anything in your project and click "Show in Finder". Search around in your project folder in the finder for a bit and you'll find it. I'm not on a Mac right now, or I'd give you a more direct path straight to the default .xcassets folder location.
And anyway, if you're not able to copy/create a "new" folder in that location because "an item with the same name already exists", then that means you didn't actually delete the folder. You just deleted your project's references to that folder in XCode. The folder on your hard drive didn't go anywhere.
[I realize this is a very old question from you #Aeveus]
All the answers talk about re-doing the adding assets again. Given you could not undo, the one step that is missing in your original description is this:
In your project.pbxproj file, there would have been references to assets as below:
45AE4E781C183FBA0051674F /* Assets.xcassets in Resources */ = {...
Assuming you have source code control system (git, etc) you can revert to the original contents of your project.pbxproj file, or manually just re-add the deleted lines, and re-open the project file in xcode. You are all set now.
I had the same problem. Open your XCode Project. Just go to File -> Add Files to...(your Project) -> Assets.xcassets and you are good to go!
I had same problem and I have followed the steps above from Jason, but finally i got Image.xassets in red color, so the in order to find my images I had to click in Image.xassets and then on the top right corner put the absolute path to my image.xassets folder and it fixed my problem.
Hope it helps!

Xcode 5: "Invalid image path" CFBundleIcons

Ok, my problem seems to be similar to this, and this, but following the answers, there is not helping me. This might be because I am using Xcode 5, before I upgraded to this version I wasn't having any problems with this app.
When I validate my app I get the following error:
"Invalid Image Path - No image found at the path referenced under key
'CFBundleIcons': 'icon152'"
So I go to the .plist file in Xcode, right click Show Raw Keys/Values and find CFBundleIcons.
There is a tree that looks like this:
▼ CFBundleIcons Dictionary
▼ CFBundlePrimaryIcon Dictionary
▼ CFBundleIconFiles Array
Item 0 String icon152
Now I've renamed icon152 to icon152.png, and it still doesn't work. Does this value require the full path to the image on my mac? And if it does, why am I not getting the full path inserted when I add the image from scratch? I've validated apps before and never experienced these problems.
I've tried removing all the icon entries out of the .plist file and re-adding them, still doesn't work.
I've tried removing the images from the bundle and Xcode altogether, and completely re-added them from scratch. Still doesn't work.
Can anybody tell me what I am doing wrong?
EDIT:
If anybody else is struggling with this, all I did to solve it was click the "Use Asset Catalog" button - and all these problems disappeared. You can find that button by clicking on your project in the Navigator, then under General scroll down to App Icons - the button should be there.
I had the same error as ckoskar,
"Invalid Image Path - No image found at the path referenced under key 'CFBundleIcons': 'icon120x120'"
I ended up deleting the file from the CarPlay section in the AppIcon part of Images.xcassets, and then I was able to submit the build.
I had the same issue, and the "Use Asset Catalog" worked for me. Maybe take it out of the resources, put it back in, clean, build and then see if it works.
To find this button : Project > General > App Icons and Launch Images
Here is what worked for me:
Select the Target
Go to Build Phases
Expand the Copy Bundle Resources
Go to the bottom of the panel and select the + sign.
Add each of the missing resources.
Can you try removing the icon from the project and adding them again? Then try to use the name without .png.
Sometimes Xcode can't see the changes if you modify the file in Finder.
I too had the same issue, the interesting thing was that I was already using the asset catalog when this happened. The solution that ended up working for me is described here:
Invalid Image Path - No image found at the path. CFBundleIcons Xcode 5
Basically you need to add the image to the target you are building. To do that, select the image in the list of files under your project in the Navigation Pane, then show the Utilities Pane on the right and check the target under Target Membership in the Utilities Pane to the left
Sometimes that happens when you add files separately.
Make sure you have the Build name's check box checked on the "Target Membership" area in the Utilities pane.
The files for which it is throwing an error would have that check box unchecked hence it does not get included in the final build.
By checking this checkbox I got my problem solved. Thank DomandoCoder!
I had problem with:
"Invalid Image Path - No image found at the path referenced under key 'CFBundleIcons': 'icon120x120'"
The solution was to move the icon (120x120) to a another appicon folder
I had the same problem. I was trying to get a Free and Full version app to upload. The free app TARGET uploaded fine though I had problems with the Paid TARGET. I selected all the images used for icons in the PAID and FREE versions and then looked at : FILE INSPECTOR --> TAGET MEMBERSHIP -> make sure to check them both and then it'll be OK. Worked for me.
Here's the error I had:
Then I selected and checked these for PAID and FREE versions of the app:
I hope this helped. Check out roulette tracker and my other apps!
Please vote if this helped you.
Well for me it was not any of these. I kept adding and cleaning to no avail
there was list of icons in the plist under:
CFBundleIconFiles~ipad and CFBundleIconFiles
There were a few in there that did not exist. I removed/ updated and that seemed to work.
Make sure the image is added to the project:
expand the Resources folder
if the file is there remove it
if the file is not there add it by right clicking the Resources folder
clean the build and rebuild
What solved to me was to check the icons that are failing and open them in preview and export as png again.
No changes in XCode, only new export of the images.
I had the similar issue with an error about iTunesArtwork and warning about 120 icon and the "Use Asset Catalog" worked for me where I filled the missing icons by dragging from project navigation pane and didn't do anything with iTunesArtwork though.
Edit:
My previous solution didn't work this time for same error for my react native app. My faulty icons images were causing this very issue. I opened one of the icon in Preview and selected the whole image area and created new image from clipboard. I replaced all the old images by these newly created images and upload went successful.
You can get this issue if your app icon name aren't correct.
I was using appicon.co which was generating wrong names that's why I was getting this error. Then I used "Icon Set Creator" iMac app to generate icons & everything worked fine after using them.
I had the error "Invalid Image Path - No image found at the path referenced under key 'CFBundleIcons': 'icon40x40'"
In my particular case I was just missing the 80x80 (40x40 scale x2) icon in Images.xcassets. The error message excludes the scale of the icon.
Adding the missing size resolved the issue for me.

Resources