Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jpeg images in Xcode project reported to to be invalid

Tags:

xcode

ios

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?

like image 970
Elardus Erasmus Avatar asked Mar 14 '23 21:03

Elardus Erasmus


2 Answers

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.

like image 145
Ozgur Vatansever Avatar answered Apr 01 '23 15:04

Ozgur Vatansever


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.

like image 37
Laura Ruival Avatar answered Apr 01 '23 16:04

Laura Ruival