lifemoveson
lifemoveson

Reputation: 1691

Could not load image Default.png

This particular stuff is getting me crazy :

Win [1365:707] Could not load the "Default.png" image referenced from a nib in the bundle with identifier "com.abc.acd"

How should I fix it and the error is only on device and not on simulator?

Upvotes: 0

Views: 1743

Answers (4)

AndrewS
AndrewS

Reputation: 8472

You are getting this error because one of your NIBs refers to the image, and (for some reason) it isn't being packaged into your bundle correctly.

  1. If you renamed your launch image (Default.png) to something different (eg MyAppBackground.png), then you'll have to find which NIB is referring to the original name and edit it to refer to the new name.
  2. Capitalization counts. Make sure you have named the image Default.png (not default.png). The device is case-sensitive, but your Mac is not. If it works in the simulator but not on device, you probably have a capitalization problem.
  3. The file must be included in the current build target. Select the image in your project hierarchy (Groups & Files), select "Get Info", and make sure that it's checked for the build target.
  4. You might need to Clean (from the Build menu) the project and rebuild. Sometimes XCode just gets confused, especially if you've been moving or renaming images. Quitting & restarting XCode might help, too.
  5. Check for duplicates of the app on the device. If you've changed the app's bundle ID, you might have this problem.

Upvotes: 0

Man of One Way
Man of One Way

Reputation: 3980

One possible reason is that the simulator finds the file because your Mac is formatted with case insensitive filesystem. That means that "Default.png", "default.png" and "DefAuLt.png" all counts as the same file.

However on the iPhone the filesystem is case sensitive which means that "Default.png", "default.png" and "DefAuLt.png" all counts as different files.

Therefore, be sure that your file actually is named "Default.png" and not "default.png" or something else.

Upvotes: 0

PSD
PSD

Reputation: 41

Just delete the app from the iphone and then clear all the target from the xcode. Then run the application again

Upvotes: 0

WrightsCS
WrightsCS

Reputation: 50697

Open the XIB in question and make sure that none of your UIImageView's have their image property set to Default.png

enter image description here

Or, if you require the Default.png to be there, make sure that it exists in your Project files.

Upvotes: 1

Related Questions