Cannot load a sprite from a folder in resources in ios

I am attempting to load a sprite from a folder using the following statement

Sprite *sp = Sprite::create("Images/CloseNormal.png");

Now Images is a folder inside resources which has the file CloseNormal.png
The above statement returns NULL
Now If I move the image outside the folder into Resources and use the following code

Sprite* sp = Sprite::create("CloseNormal.png");

The above works

My directory structure in ios looks like this

|_Resources
   |_Images
        |_CloseNormal.png

Any suggestions why it cant load sprites from folders inside resources ?

It should work in Android.

For ios first delete Images folder from Xcode. be carefully just remove reference don’t move to trash. you have right click on Resource folder -> Add files to “Proj Name” -> select Images folder and checked “Create folder references”. You see the Images folder color is Blue, Don’t select create group.

If you select create group option then Folder color is Yellow. And then It should not working.

1 Like

Thanks a lot. you save my day.