Image not found on device but works in simulator.

Hi,

I’m trying to build my first application and I think a stupid thing is blocking me. I tried to search the forums but none of the suggested solutions matches my problem.

I have a black screen when I launch the application on my phone. After looking at the log, the problem is:

V/Corona  (31568): WARNING: Asset file “gfx/bg main.jpg” does not exist.

Every other threads I’ve read are solved because it was a case problem on windows platform. But I’m using Mac OS…  :frowning:

Here is my base folder:

2k07du.png

I tried to rename it, without space, moved it out of the gfx folder to the root of the project. I’m still getting the “Asset […] does not exist” error.

What am I missing?

Thanks a lot.  :) 

I would suggest not using spaces in your file names.

Instead you can use either an underscore, or an lower case upper case system… i.e. myFile.jpg or my_file.jpg

After doing that, update the image path in your code to suit.

Ex:

local img = display.newImage( "gfx/myFile.jpg" ) 

Also, ensure that your image path in your code matches the file name (and case) exactly, as this is very important.

Hope this helps

Hi,

Thanks for trying, but as I stated in the original post, my OS is already case sensitive and I’ve tried every variation in the name I could.

In fact I found the cause by myself. Silly me copied a template of build.settings , there was the option  usesExpansionFile = true  and that was the thing that prevented the assets to be added to the build.

Interesting, glad you found the cause of the problem :slight_smile:

I would suggest not using spaces in your file names.

Instead you can use either an underscore, or an lower case upper case system… i.e. myFile.jpg or my_file.jpg

After doing that, update the image path in your code to suit.

Ex:

local img = display.newImage( "gfx/myFile.jpg" ) 

Also, ensure that your image path in your code matches the file name (and case) exactly, as this is very important.

Hope this helps

Hi,

Thanks for trying, but as I stated in the original post, my OS is already case sensitive and I’ve tried every variation in the name I could.

In fact I found the cause by myself. Silly me copied a template of build.settings , there was the option  usesExpansionFile = true  and that was the thing that prevented the assets to be added to the build.

Interesting, glad you found the cause of the problem :slight_smile: