XCode 4 CpResource error - ipad

When I build my app with Xcode 4 it always show this error message:
CpResource "Color Calculator/X.png"
"/Users/mauro/Library/Developer/Xcode/DerivedData/Color_Calculator-eomtenpvfeomibgervrskkupofrx/Build/Products/Debug-iphonesimulator/Color Calculator.app/X.png"
It seems that Xcode wants to copy X.png in the DerivedData.
But I don't have X.png in my project. I use to have it, but it was deleted some versions ago (with many other png).
In order to verify, I deleted all the objects in project's xibs. So now I have two empty xib, however the error message continues to appear.
Thank you.

Click on your project, go in the tab "Build phase" then in the tab "Copy bundle ressources" and delete the .png to tell xcode to stop trying to copy it :)

In my case I removed the icon and added my "LAUNCH SCREEN and MAIN STRORY BOARD".

Related

ios App Icon is missing in the simulator using react native

I added the script that I found in another post but no luck. I cleaned the build folder hundred times but nothing is working.
Actually in my case the target has been set correctly. All I needed to do was to turn off the simulator and let it get started by the build again.
Have you checked the "Target Membership" in the right-side pane?
Go to "images.xcassets" under your project
Click "AppIcon" or any image asset you have for your project
Show the Inspector on the right
See if "Target Membership" is checked correctly for your app.
Select Target from Xcode then navigate to General Tab and under "App Icon and Launch Images" section select "App Icons Source" -> AppIcon
It was greyed out in the Target membership. I fixed that and it worked.

Missing default-568h#2x launch image, launch image won't display

I set up the launch images as so, XCode forced me to rename the images which is ok, but for some reason when I run iOS Simulator, there is no launch image displayed. Instead, a black screen is displayed. Previously I had the warning Missing default-568h#2x launch image which went away when I clicked add on the menu that was popping up when I expanded the warning. However the launch images still do not display when launching the app. I have tried resetting all content, cleaning, building, and then running again, but nothing seems to be working. Additionally, XCode did not rename any of my images to default568h#2x so I'm assuming that is a problem, even after I clicked add. I do have launch image set to default in info.plist.
Any suggestions?
I meet the same problem, but the result comes out because i changed the Launch Image Source Setting.
Here is how I fix it:
Go to the target in the Project Editor
Select the General tab
Find the "APP Icons and Launch Images" section and click "Launch Images Source"
If the current state is "Use Asset Catalog", select "Migrate".
Problem Solved.
Xcode 11 outputs this error if you move your Info.plist file and forget to tell Xcode about the new location in Build Settings.
The Info.plist contains metadata about your LaunchScreen storyboard/image. Apparently, Xcode assumes you want to use a launch image (and did not provide one) when it cannot find the target's Info.plist file. Updating the Info.plist location in Build Settings fixes this disconnect:
Select the Project file (top item) in the sidebar.
Select the Target in the Project editor.
Select the Build Settings tab in the Project editor.
Scroll/search for "plist", or "INFOPLIST_FILE" to be exact.
Double-click the plist entry to edit it, and type in the correct location for the Info.plist file.
(e.g. if you moved it to a Resources folder within the MyGreatApp project root folder, set the value to "MyGreatApp/Resources/Info.plist")
This is not the OP's situation (they intended to use launch images), but I thought I would add this breadcrumb for anyone like me who got this error after moving an Info.plist file.
I am guessing but just try following steps :
Go to the launch image path in your resources .
Copy paste your image and give the same name default-568h#2x
Try to clean and build the project .
Then also if you are not seeing the image then just simply delete the application and install it again .
No need to name a file like that.
Just doing this solves the problem :
1. Add launch images inside assets by right click / add new files.
By doing this, you will add launge images set.
2. Then set all of these launge images.
To see the sizes do these : Select the image then you can check the size on the property inspector at right. Like this:
If (as opposed to all the previous answers) you're not interested in any launch image at all (i.e. the error appeared after deleting it), the following suffices:
1. Product > Clean
2. Product > Build
I am using Xcode 11.3.1, and I just did a project clean up, this warning is gone:
⇧ + ⌘ + K to Clean Build Folder.
Close Xcode.
Re-open Xcode.
Re-build project.
None of the suggestions worked, but this did
Delete the targets that cause the error
Recreate the target
Problem solved 🎉
Clean project
Build project
Toggle issue navigator window
In the issue navigator window there will be a warning message saying Missing Default-568h#2x.png
Click that issue
The dialog will come up prompting to add the missing file
Hitting add will place the file (all black in colour) into the root of the project
Issue solved

I get an error "None of the input catalogs contained a matching launch image" in xCode5-iOS7

I'm trying to define launch images. Probably only one image is missing.
I'm following the instructions from this site Create launch images in different sizes for different devices
So I have 7 images with the required size.
But when I drag them to LaonchImages sheet it requires 8 images...the one that is missing is called "iPhone Portrait 2x" and according to the details pane I found its size 640x960 and I added it.
sill I'm getting the error - and the compilation fails...
Select your project, go to Build Settings, search for AppIcon-2 and change it into AppIcon and you will be fine.
Select project file and then select target in question. In General tab there is in app icons and launch images launch image source should be "Use assets category"
My LaunchImage file had been deleted and I had to add a new one in my xcassets.
Go to your images.xcassets. If there is no LaunchImage listed on the left, click the plus button at the bottom and navigate to new iOS launch image.
The Launch Image asset has been deprecated. I deleted the Launch Image asset but then I was getting compilation error.
In order to fix the error, the Launch Image asset catalog name has to be removed from Build Settings.
I could solve this by going to Build Settings of my target, searching for word "launch", then removing (using Backspace) "Asset Catalog Launch Image Set Name", that was set to LaunchImage.
In my case the problem was solved by removing the reference to Images.xcassets and then add it to the project again.
I'm not sure what caused the problem, but it may have something to do with the fact that I moved the assets "file" from one Xcode group to another, which would be weird as the file's path remained the same, but that was also the only thing I did with the file...
We had our Asset Catalog Launch Image Set Name set in our project target. After removing this from the target and instead setting it in our project it compiled fine.
For me the problem occurred when i have added a new watch target. Even though i had AppIcon set i was getting the error, i fixed it by removing the reference of asset catalog and added it back, you can do it by deleting the reference and add it back.
This generally happens when you have accidentally deleted Assets.xcassets. You need to follow the below steps.
Right click on Assets.xcassets and select Show File
Inspector.
Check if the desired target has been checked under
Target Membership.
If its unchecked, Please select the target for which you need the
Assets to be used.
Clean and Build the App.
With xcode 11.3.1 you have to select the project file and after that, select the target in question, and in the General tab under "App Icons and Launch Images" select as shown bellow.

Missing MainStoryboard Xcode 5

I have a problem with my Xcode project, In my MainStoryboard.storyboard it's showing missing(red) In "Build Phases" -> "Copy Bundle Resources". Then I can edit the StoryBoard but their changes are not shown when I run the application. Everything works fine until I change to use Xcode 5.
I can put here an image because I don't have enough reputation, but its showed in red in "Copy Bundle Resources" section.
Can anybody help me? I don't know what happened to my MainStoryboard.

App Icon not showing up, although I have added in Xcode 5

I have added the icon as shown in the pic below but I am still not seeing the icon in my device or simulator.
This might be an XCode 5 bug that the added icons are not actually included in the app bundle, but you can work around it by going to Build Phases, expand Copy Bundle Resources, then press the "+" sign in the bottom to manually add the icon files to this category.
In addition iOS 5/6 seems to have a bug that the screen doesn't update the app icon even if the icon files are included in the bundle. To work around it (as suggested by josema.vitaminew at App Icon not changing when app version is updated in iOS 5 simulator) you can drag the app icon into a folder, then iOS will update the appearance of it.
If using the Asset Catalog, it might be worth also checking whether Images.xcassets holds all your targets as shown in the below image.
Expanding on adp's answer, if anyone has switched to asset catalogs but they stopped working, and still can't find a solution for Asset Catalog, Images.xcassets, AppIcon or LaunchImage not working, here is a reproduction of the same problem I encountered, and the solution:
I had upgraded to Xcode 6 and opened a project created by an earlier version (4 or 5, not sure) and no matter what I did, AppIcons and LaunchImages absolutely would show up when I ran the app in either iOS Simulator or the device.
I tried Xcode->Product->Clean, Xcode->Window->Organizer->Projects->Derived Data->Delete..., relaunching Xcode and the iOS Simulator, then rebuilding and relaunching the app (failed).
I tried "Reset Contents and Settings..." in iOS Simulator and even deleting ~/Library/Developer/Xcode/DerivedData//Build/Products/Debug-iphoneos and relaunching the app (failed).
I tried archiving the project, hoping that it was just an issue with the iOS Simulator, but the icon in the Organizer-Archives window was still shown as the default white square with lines, confirming that the icon would also not show on a device (a helpful trick to have when no device is handy). (failed).
I tried choosing "Don't use asset catalogs" in Target Settings and creating a new AppIcon-2 and LaunchImage-2 (failed). -this is what cost me at least 2 more hours, because this should have worked and the fact that it didn't revealed the bug in Xcode but I just couldn't see it-
I tried creating a new project from the single view template and compared all of the Info.plist settings (failed).
I tried comparing the new project's Contents.json with mine in Images.xcassets (failed).
I tried dragging the images from the left sidebar Navigator into the AppIcon image wells, hoping that they were just not being copied in a build phase for some reason (failed).
Finally in exasperation at the thought of having to create a new project just to fix the icons, I tried deleting Images.xcassets in the left sidebar Navigator and choosing "Move to Trash", then quitting Xcode and relaunching in case it cached anything. Then when I went to click the App Icons Source popup menu, it only showed "Don't use asset catalogs". I had to select it in order to bring back the "Use Asset Catalog" button. Then I was able to create new AppIcons and LaunchImages, drag images to the wells, build and launch the app in iOS Simulator and finally see icons appear properly.
So the problem appears to be with how Xcode stores Images.xcassets inside the project, and not with target membership, derived data, or anything in Images.xcassets itself. You must remove your assets file and create a fresh one, then drag images to wells by hand again.
It took me 3 hours of research to solve something that should have "just worked" and the entire process of having to manually create individually sized art assets has been so tedious over the years that it has personally cost me countless hours of busywork.
Hopefully this bug workaround helps someone avoid the frustration I went through. I can't help with the friction of manually sizing art assets, but I highly recommend the Icon Slayer website to automate that (of which I have no affiliation).
I have encountered the same problem when the project is switching from xcode5 to xcode6 . The solution is just click on the icon in the image asset,open the right panel , just tick the iOS version option in the panel,add the icons that are blank run it again ... It worked for me
I want to add my solution, where the problem is only isolated to the iPad, my app icon will not show only for iPads. After trying all the solution above, and I looked in the info.plist and found this flag that was not there before the problem with iPads. A new key/value has been added called "CFBundleIcons~ipad" without my knowledge and had nothing as it's value. Removing the key helped resolve my issue.
According to Apple Docs, the icons must be placed on the root level of the app files.
IOS/Xcode will not go under directories to search your image.
Solution is to move the images onto the root of your application i.e. where your source files are, or you can create references in the same way.
Regards
Heider
In my case, I just needed to clean and rebuild my project.
I had the same problem and after a couple of hours finally I could resolved it, copying an old -info.plist from one of my backups project and replace it, this works fine for me.
Regards
My issue ended up being I had used jpg images, rather than pngs.
For me, it was a much simpler solution than the others listed here. I had simply got the assets the wrong size. I had not paid attention to the multipliers that are necessary (e.g. 2x or 3x) and therefore the build was generating a warning for the incorrect asset sizes (which I had ignored). In my case, I corrected the image sizes and voila they appeared in the simulator.
For a macOS/OSX application, you also need to always add a 128 pixel size (and 2x), you can not only use a 512 pixel size and expect it to size down.
If your app icon has any transparency then it won't work. Check it!
I had all the images in the relevant folders and when I right clicked on the empty icon image in Images.xcassets/AppIcon and chose show in finder it would find the image correctly and show it, but for whatever reason it wasn't adding correctly to the project.
After trying a lot of different things above I simply dragged the images from finder into the AppIcon area and it worked.
If you are using cocoapods be sure to check this answer from a related question. After many lost hours, this is what fixed it for me.
https://stackoverflow.com/a/46349476/1343140
Xcode 9.3:
Open your project and add AppIcon images.
Click on general, go to "App Icon and Launch Image"
Click "App Icon resource" and add AppIcon (In my case it added AppIcon-1, so you can use that on rename that and do above step again).
In my case, I updated Build Rules > Using > to "Asset Catalog Compiler"
instead of any custom script and it worked for me.
I had this issue. Following the steps everyone provided did not help. However, it was because of my own ignorance. I had an issue with duplicate resources being created and one of the suggestions was to remove items from copy bundle resources. Well, it never mentioned that the asset folder was required to be in there so I deleted it. After fighting with this issue for 5 hours and recalling that it use to be in copy bundle resources I added it back and the app Icons worked.
Xcode copy bundle with appropriate file included.
make sure you create your appicons with an image 1024x1024
make sure you set 'app icon source' (project > general > App Icons and launch images) to the appropriate icon folder.
make sure you have not deleted the copy bundle resource for said app icon folder like i did.
cocoapods has a forum for a specific issue if all else fails.
Hope this helps.

Resources