Director error debugging hint

This has come up a few times recently.
Director gives the obscure error:
ERROR Failed to execute new( params ) function …

If the app works fine in the Simulator but not on your device, it’s possibly because the Simulator is NOT CASE SENSITIVE.
Your iOS device IS CASE SENSITIVE. Possibly Androids too.

Check through your code and make sure you are calling functions with the correct case and have your assets with the same case as in your code.

eg.
[lua]myImage = display.newImageRect( “FunkyImage.png”, 39, 64 )
MyImage.x, MyImage.y = 200,300 – Different case for myImage[/lua]

You will probably get an error.
The same if your image in the actual folder is “funkyImage.png”
It will probably run fine in the Simulator but not once it’s on your iPhone.

Folder names can be an issue as well.
graphics/
is not the same as
Graphics/

Unfortunately, the error given by Director isn’t really helpful as it’s generic. You know something is wrong, but not exactly what.

Case bugs are not that easy to spot :wink: [import]uid: 10389 topic_id: 21758 reply_id: 321758[/import]

Good post, will hopefully help others - and YES - case matters on Android too. A wrong capitalization on Android will cause an “application corrupted” error.

Peach :slight_smile: [import]uid: 52491 topic_id: 21758 reply_id: 86426[/import]

Hi,

I have another instance for this issue. One of my lua file I have included tableView.lua twice and got this issue. Have gone thru the scripts and removed it. and working file.

Also, I have used custom fonts but not included in the directory in another lua file got the same issue.

Corrected both and working Fine. Hope it will help others.

Cheers
Dhanasekar [import]uid: 100970 topic_id: 21758 reply_id: 98528[/import]