[Resolved] App crashes on device, runs well on simulator

I created a simple game - works very well on the simulator, but when I build for (provisioned) device it crashes immediately on startup - I see no device logs relating to the app in xcode orginizer, tried uploading to 2 iphones and a new ipad - all same results.

What’s the guidelines for debugging this issue?
[import]uid: 124146 topic_id: 25005 reply_id: 325005[/import]

Are you using director/storyboard or is your code all in main.lua?

What you want to do is look at the first things that happen when the app loads. Ads, gamenetwork, etc. whatever comes first.

Commenting out parts of your code then testing is often the fastest way to isolate the issue.

Peach :slight_smile: [import]uid: 52491 topic_id: 25005 reply_id: 101593[/import]

Put in a bunch of print statements and view the “Console Log” in Xcode’s Organizer while tethered. [import]uid: 19626 topic_id: 25005 reply_id: 101603[/import]

@mindBomb: I had a similar problem and I got crazy. Finally, I found out the reason of the problem. I was using subfolders with .lua files inside. If you export to apple devices, you can use subfolder without any problem , but they can’t contain .lua files. Otherwise, when the game run on the iPad, it can load the .lua files, therefore the game crashes. So, all .lua files has to be in the root level of your app.

I hope it can be useful for you.

See you. [import]uid: 47279 topic_id: 25005 reply_id: 101998[/import]

Hey, just to clarify you CAN use subfolders on apple devices for your lua files but you need to load them differently.

See question 5 here; http://blog.anscamobile.com/2012/04/faq-wednesday/

You need to use . rather than / where lua files are concerned.

Peach :slight_smile: [import]uid: 52491 topic_id: 25005 reply_id: 102095[/import]

Also check file name case : bitmap.png versus Bitmap.png

Im sure I read somewhere that it can differ on the device.
[import]uid: 108660 topic_id: 25005 reply_id: 102105[/import]

thanks guys for the helpful responses.
Solved the issue -
I was trying to display.newImageRect with an image which was larger than 2000x2000 that caused the crash. Just resized the image in photoshop and everything is working now…

[import]uid: 124146 topic_id: 25005 reply_id: 102132[/import]

thank you for the information, I did not know that. I like it!!. You should add a “I like it” button in the forum :slight_smile: [import]uid: 47279 topic_id: 25005 reply_id: 102637[/import]

Thank you for posting your solution Mindbomb. This issue had me eating my hair, I was trying to load in an image with the resolution of 4000x4000 in my main.lua file.

Is there any way to load this image without the app crashing? [import]uid: 14018 topic_id: 25005 reply_id: 111085[/import]