4

After upgrading (Swift and Xcode - some time ago already), I now have a warning for every .JPG image in my project (I have 200+ JPG images in the project):

The image set "Image1" references a file "Image1.JPG", but that file does not have a valid extension.

How do I get rid of the warnings/fix the root cause of the issue?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Elardus Erasmus
  • 135
  • 1
  • 11
  • http://stackoverflow.com/questions/32632577/xcode-7-warning-the-launch-image-does-not-have-a-valid-extension – Yuchen Dec 13 '15 at 20:37

3 Answers3

6

It looks like .JPG is not a valid file extension for Xcode 7. Try changing all .JPG to .jpg and the problem should be gone.

Same rule applies to images with .PNG extensions too.

Ozgur Vatansever
  • 49,246
  • 17
  • 84
  • 119
  • It works. Thanks. Now to go rename 140 images to lower case and import them into the project again :-( Whats worse is that this is the way that the images have been exported from the Photos program - one program does it this way and another does not accept it. – Elardus Erasmus Dec 17 '15 at 19:41
  • This same issue caused the issue on http://stackoverflow.com/questions/32632577/xcode-7-warning-the-launch-image-does-not-have-a-valid-extension earlier! – ReinstateMonica3167040 Dec 23 '16 at 00:56
1

To clarify, it's true that you need to use a lowercase .jpg extension, but you don't have to import all of the images again. You can just rename the image files in the imageset folder to have a lowercase extension and edit the contents.json file associated with it to reference the lowercase .jpg extension.

0

To rename hundreds of image extensions in one go: In Xcode right click an image > Show in Finder > change to List view (or press ⌘+2) > highlight / select all folders with .imageset > press right arrow to expand all in one go > now select all folders including all image files inside > right click > Rename X items > Replace Text > Find: .JPG Replace With: .jpg.

user2332921
  • 369
  • 1
  • 3
  • 7