Sprite sheets failing on iOS device/Xcode only

I have a series of image sheets I’m attempting to load for a character graphic, and the sheets aren’t loading on only iOS devices and Xcode Simulator. No errors are being reported on the graphics.newImageSheet method, but its returning a nil value. The image sheets are using the advanced method of sprite data (used TexturePacker), and they include the sheet width and height. 

Error: Bad Argument to #1 to newSprite (imagesheet expected, got nil)

Things I’ve already done to attempt to resolve:

I reduced the image sheet sizes to below 1024x1024

I’ve tried various print statements to see if the sheet data is there and accurate, which it is.

Tested on Android (works fine)

Tried adding, removing, and changing the sheetContentWidth/sheetContentHeight in the sheet data

I’m really at my wit’s end on what to do next. Any suggestions?

Errors like this usually point to a name mismatch. A good control test is to change all file names/directories to lowercase letters and re-test.

Yea, tried renaming them, haven’t tried taking them out of the folder directory though, I’ll test that next. 

What version of Corona SDK are you running? If you’re not running 2830, the latest public build I would install it. The reason is it makes getting the device’s console log way easier.

Once you have that run it it again and look for errors and warnings in the console log. You said you’re not getting errors, but then you posted an error above, so I’m a bit confused, which is why I want you to look at the entire console log.

Also can you post the relevant code.

Rob

Here’s the snippets that matter… the first is the portion of my graphics data that loads the image sheet data and the image sheet itself, the second is the loading of said image sheet into a sprite. Below this is the console data from the simulator and then Xcode. You’ll notice that printing the table in the Xcode does not show any of the image sheets, showing that they are returning as nil in Xcode Simulator, but not in Corona Simulator. 

[lua]

gladiatorGraphicSheet = {}

gladiatorGraphicSheet[“Sword”] = {}

gladiatorGraphicSheet[“Sword”].deathBackData =  require(“Gladiator.SwordPoses.AttackDeathBack”)

gladiatorGraphicSheet[“Sword”].deathBackSheet = graphics.newImageSheet( “Gladiator/SwordPoses/adb.png”, gladiatorGraphicSheet[“Sword”].deathBackData.sheet )

[/lua]

[lua]

printTable(gladiatorGraphicSheet[weaponType]) – Prints images posted below

self.backLimb = display.newSprite(gladiatorGraphicSheet[weaponType].deathBackSheet, gladiatorBackSequenceData[weaponType] )

self.backLimb.anchorX = 0

self.backLimb.anchorY = 0

self:insert(self.backLimb)
[/lua]

Images of printTable statement in Corona Simulator and Xcode- http://imgur.com/a/98hd9

aJw6KM8.png

lkMDyUG.png

Solved it! The project name and the folder name are the same (Gladiator) and apparently iOS didn’t like that. 

Glad you’ve solved it.

Errors like this usually point to a name mismatch. A good control test is to change all file names/directories to lowercase letters and re-test.

Yea, tried renaming them, haven’t tried taking them out of the folder directory though, I’ll test that next. 

What version of Corona SDK are you running? If you’re not running 2830, the latest public build I would install it. The reason is it makes getting the device’s console log way easier.

Once you have that run it it again and look for errors and warnings in the console log. You said you’re not getting errors, but then you posted an error above, so I’m a bit confused, which is why I want you to look at the entire console log.

Also can you post the relevant code.

Rob

Here’s the snippets that matter… the first is the portion of my graphics data that loads the image sheet data and the image sheet itself, the second is the loading of said image sheet into a sprite. Below this is the console data from the simulator and then Xcode. You’ll notice that printing the table in the Xcode does not show any of the image sheets, showing that they are returning as nil in Xcode Simulator, but not in Corona Simulator. 

[lua]

gladiatorGraphicSheet = {}

gladiatorGraphicSheet[“Sword”] = {}

gladiatorGraphicSheet[“Sword”].deathBackData =  require(“Gladiator.SwordPoses.AttackDeathBack”)

gladiatorGraphicSheet[“Sword”].deathBackSheet = graphics.newImageSheet( “Gladiator/SwordPoses/adb.png”, gladiatorGraphicSheet[“Sword”].deathBackData.sheet )

[/lua]

[lua]

printTable(gladiatorGraphicSheet[weaponType]) – Prints images posted below

self.backLimb = display.newSprite(gladiatorGraphicSheet[weaponType].deathBackSheet, gladiatorBackSequenceData[weaponType] )

self.backLimb.anchorX = 0

self.backLimb.anchorY = 0

self:insert(self.backLimb)
[/lua]

Images of printTable statement in Corona Simulator and Xcode- http://imgur.com/a/98hd9

aJw6KM8.png

lkMDyUG.png

Solved it! The project name and the folder name are the same (Gladiator) and apparently iOS didn’t like that. 

Glad you’ve solved it.