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.
Related
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
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!
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.
While reading /Users/user/Desktop/AppProject/PruebaApp/Logo Retina.png
pngcrush caught libpng error:
Read Er Could not find file:
/Users/user/Library/Developer/Xcode/DerivedData/PruebaApp-cblepoaxbqzyopcbcswwqjtftyon/Build/Intermediates/ArchiveIntermediates/MaderoAPP/InstallationBuildProductsLocation/Applications/MaderoAPP.app/Logo
Retina.png
Command
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng
emitted errors but did not return a nonzero exit code to indicate
failure
Im getting these errors while archiving project, at the end it does archive but i want to get rid of it. I had trouble with the app before and i read that i should delete the DerivedData/(myproject)folder so i did. and apparently it is trying to look for the images in that folder how do i fix this??? Help!
Try first by Hard Cleaning your project CMD+OPTION+SHIFT+K, If problem exists apply following method,
Build Phases -> Copy Bundle Resources, Any fileName is red color?
Or
Convert Logo Retina.png or Create it again, maybe it's an encoding\format issue.
Or
Rename "Logo Retina.png" to "LogoRetina.png".
~Good luck~
It also happens when you have multiple images with the same name in TARGET->Build Phases->Copy Bundle Resources. To resolve it -
Search for the image name that you are getting an error for in Build
Phases search bar at the top.
If you get multiple results in Copy Bundle Resources for the search query, just remove others from it by clicking on "-" sign. Make sure you have same images for the multiple results. If not you have to rename the actual files of other entries.
Just compile your code. You are good to go.
Hope it works for you.
Just open image in Preview app and export it as png file. Replace old image with new in Xcode.
Honestly I have had this problem intermittantly many times and clean then rebuild has fixed it.
Since the answers here are either not useful at all or quite complicated I want to add mine:
The error means that Xcode can not find the file, whether it is in the project's folder or not.
If you still need that image, what you can do is to open a Finder view and navigate to your project. Drag the file Xcode was complaining about into the project an uncheck 'Copy to folder'.
if you do not need the file anymore, on the left side of Xcode, find the file, it will be shown in red, simply tap on it and then delete / backspace
Hope that helps some people :)
To solve the issue copy the Image name. Then Filter it (Build Phases -> Filter textfield). Finally I removed it.
Also check that you are not naming the images with only a number like "0.png" I change it to "tuts0.png" and it worked.
I just had this error and honestly I think it was being caused by another error. I had an issue with my Crashlytics framework and I'm convinced it was effect some unassociated pngs with the copypng error. I replaced the Crashlytics.framework with a fresh version and viola, all errors were gone.
Don't ask me how this works, I'm just posting this in case someone else can benefit from it.
I wasn't able to fix this problem. So i delete and reinstalled xcode, this helped for me.
Fixed it by reverting to my old product name (in "Build settings"). Seems that the new product name confused the images path.
I have the same issue with resources. The problem was that I have copied target from another one and just forget to uncheck checkbox at target membership window.
i face this problem and this solution is working form me
you need to remove any reference for that image
Build Phases -> Copy Bundle Resources
after that clean and build and problem will be fixed
I had accidentally deleted the file from the location which was linked to x-code project. I had not copied the file in my xcode project but just the path. Hope it helps someone.
I've had similar issues with pngcrush /libpng crashing with PNGs (checksum errors / freeing object that have been freed etc). These could be reproduced on the command line so I recreated the PNGs, even converted them to other formats then back but the errors persisted. In my case Xcode then rejected the resulting archive for not having iPhone 5 support (as pngcrush killed the Default-568h#2x.png image). The above fix resolved this.
For those who are struggling with this error while building Cordova app.
Please keep the following point in consideration as it may lead to this error.
The images should be tagged as "resource-file" and not as "source-file" in plugin.xml of your Cordova plugin as the former includes the images in "Copy Bundle Resources" (under Build Phase) and the latter to "Compile Sources" of your equivalent xcode project of cordova app.
If non of above answers can fix your problem, try look into Xcode project where you reference your image file, I happened to referenced twice to the same png file. Once I delete one the reference, it worked. The error went away. Good luck.
It also happens when you have multiple images with the same name in TARGET->Build Phases->Copy Bundle Resources. To resolve it -
Search for the image name that you are getting an error for in Build Phases search bar at the top.
If you get multiple results in Copy Bundle Resources for the search query, just remove others from it by clicking on "-" sign. Make sure you have same images for the multiple results. If not you have to rename the actual files of other entries.
clean cmd+option+shift+k and Build Project...
work well for me....
The app builds fine in a simulator and on a device. But as soon as I try to archive it for submission I get:
While reading /Users/adga/Documents/Adams Lokalt/Appar/NU SÅ/VertragingsApp/Rotation/Customization/Herfst2011/../../../default#2x.png pngcrush caught libpng error:
PNG unsigned integer out of range.
I've tried to open in photoshop and replace (without interlacing) but it doesn't work.
Any ideas?
I receive such error when just try to run my project.
This error could occur when you have duplicate file references (I have this problem because I change my png images). You can check, all of your copying files in Bundle Resources and for me there was more than one copy of each "error png file".
You can open Bundle Resources following this steps: click on your project name in Project Navigator tab, then choose your project in Targets. After that, you must choose Build Phases tab. You'll see a list of items: "Target Dependencies", "Compile Sources", "Link Binary With Libraries", and what we're looking for Copy Bundle Resources. Here you can see all your resources that you add to your project.
To fix this error, you must remove all error files from this list.
After that you also delete this files in Project Navigator, choose all files that needs to unlink from project, than right click on them and choose delete, then choose Remove Reference. All we need is to remove all references from our project.
All things done, right now we must add our files back. Click to Project Navigator zone with right button (or to a particular folder/group) and choose Add Files to "Your Project Name" and choose all files you need to delete.
Remember, that you remove reference from files previously and they are just waiting to be added again in your project folder.
Another reason when such error occur is when .png file is not a proper .png file, in this case you need to re-save file to png extension. You can open your image file in Preview and save it to png from here. If you have a big amount of images, you can use Automator to help you in your task. Hope this help.
I faced the same issue as well. I just restarted xCode and recompiled. I did not have that problem thereafter.
I met this problem too. Though the project still could be compiled, it is really annoying.
I resaved the png without interlacing to another place and replace the original one instead of just resaving it at the original place. This did work for me, why you just try this again?
I received this problem when I added two images to a project that already had references to them. Once I removed the duplicate reference, the error disappeared.
I had the same problem and error disappeared after simple step in photoshop. Open your existing png file with photoshop and re-save it as "Save for web & devices"...that did the trick for me!