Dev app crashes on iOS

My project runs fine locally, but when I try to run it in the development app on my iPad Mini, the screen goes black for a few seconds and then the app quits.

This is the system log on the device. Any ideas?

Jul  7 14:30:25 Karls-iPad-Mini syslog_relay[11578] <Notice>: syslog_relay found the ASL prompt. Starting...
Jul  7 14:30:31 Karls-iPad-Mini SpringBoard[54] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Jul  7 14:30:31 Karls-iPad-Mini kernel[0] <Notice>: xpcproxy[11592] Container: /private/var/mobile/Containers/Data/Application/767C1B23-D252-413A-86F4-A43BB47078B9 (sandbox)
Jul  7 14:30:31 Karls-iPad-Mini com.apple.xpc.launchd[1] <Error>: assertion failed: 13F69: launchd + 116796 [9F6284CF-8A17-36CC-9DB5-85D510A21F14]: 0x3
Jul  7 14:30:38 Karls-iPad-Mini SpringBoard[54] <Warning>:  * bad fence setup * we're setting up a potentially deferrable transaction while we are already tracking an animation fence - this will probably cause us to blow the fence
Jul  7 14:30:39 Karls-iPad-Mini backboardd[56] <Warning>: CoreAnimation: timed out fence 3dadb
Jul  7 14:30:39 Karls-iPad-Mini SpringBoard[54] <Warning>: CoreAnimation: failed to receive fence reply: 10004003
Jul  7 14:30:39 Karls-iPad-Mini backboardd[56] <Warning>: CoreAnimation: failed to receive fence reply: 10004003
Jul  7 14:30:48 Karls-iPad-Mini SpringBoard[54] <Warning>: Forcing crash report of <FBApplicationProcess: 0x1477c3100; dmengine; pid: 11592> (reason: 1, description: test.railshuffle failed to scene-update after 10.00s)
Jul  7 14:30:48 Karls-iPad-Mini diagnosticd[11499] <Error>: error evaluating process info - pid: 11592, punique: 11592
Jul  7 14:30:48 Karls-iPad-Mini SpringBoard[54] <Warning>: Finished crash reporting.
Jul  7 14:30:48 Karls-iPad-Mini SpringBoard[54] <Warning>: BSXPCMessage received error for message: Connection invalid
Jul  7 14:30:48 Karls-iPad-Mini SpringBoard[54] <Warning>: Unable to get short BSD proc info for 11592: No such process
Jul  7 14:30:48 Karls-iPad-Mini SpringBoard[54] <Warning>: HW kbd: Failed to set (null) as keyboard focus
Jul  7 14:30:48 Karls-iPad-Mini mediaserverd[25] <Notice>: '' test.railshuffle(pid = 11592) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None
Jul  7 14:30:48 Karls-iPad-Mini mediaserverd[25] <Notice>: '' (pid = 11592) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None
Jul  7 14:30:48 Karls-iPad-Mini com.apple.xpc.launchd[1] (UIKitApplication:test.railshuffle[0xd661][11592]) <Notice>: Service exited due to signal: Killed: 9
Jul  7 14:30:48 Karls-iPad-Mini ReportCrash[11593] <Warning>: Saved type '109(109_dmengine)' report (2 of max 25) at /var/mobile/Library/Logs/CrashReporter/dmengine-2016-07-07-143048.ips
Jul  7 14:30:48 Karls-iPad-Mini SpringBoard[54] <Warning>: Application 'UIKitApplication:test.railshuffle[0xd661]' exited abnormally via signal.

Could you try building and running some of the other demo projects to see if they cause a crash?

Try to reboot your device fully once?

Did it work before and then stop working?

Try to close all other running apps?

Does your project have a TON of stuff going on at once?

Karl, do you get the same kind of crash if you bundle it as an IPA and install it?

  • The demo projects work.

  • Rebooting did not help.

  • I have not tested this particular project before.

  • I tried closing all other apps. No difference.

  • There is not much going on when the game starts.

I get a different crash when I bundle the game as an IPA. Then the main menu shows up, but everything just freezes.

Below is the corresponding system log. I’m curious about the last line, which seems to indicate that the app can’t save a file. That’s one of the first things the game attempts to do when it starts. It sets up a default settings table and saves it, if it doesn’t exist already. Is there some kind of extra setting to enable that on iOS?

Jul  8 10:32:23 Karls-iPad-Mini syslog_relay[11912] <Notice>: syslog_relay found the ASL prompt. Starting...
Jul  8 10:32:28 Karls-iPad-Mini SpringBoard[54] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Jul  8 10:32:28 Karls-iPad-Mini kernel[0] <Notice>: xpcproxy[11913] Container: /private/var/mobile/Containers/Data/Application/FCF989EC-A73B-4C74-9042-25836526A7EB (sandbox)
Jul  8 10:32:28 Karls-iPad-Mini com.apple.xpc.launchd[1] <Error>: assertion failed: 13F69: launchd + 116796 [9F6284CF-8A17-36CC-9DB5-85D510A21F14]: 0x3
Jul  8 10:32:29 Karls-iPad-Mini kernel[0] <Notice>: Sandbox: Rail Shuffle(11913) deny(1) file-write-create /settings

Updated: I removed the file management code, but that didn’t help.

If demo stuff works then make a copy of your project and remove stuff you think might be causing it until it work. Alternatively make a new blank project and begin to add the same stuff back in until it doesn’t work.

Karl, how are you saving your file? Using sys.save() or io.write()? Are you using sys.get_save_file() to get a “safe” path to use as input to sys.save and io.open?

I removed literally everything from the main collection object. Then, obviously, the project worked.

  • I tried adding a game object - fine.
  • I created an empty GUI file and added to the game object - fine.
  • I created an empty GUI script file for the GUI - fine.
  • I added an atlas to the Textures of the GUI - CRASH.

Further tests showed that a very small atlas works, but as soon as it reaches 1024x1024 or bigger, a crash will inevitably occur.

So it looks like a memory issue, but I’m not running any other apps on the device. Is there some kind of resource size limit for Defold projects on iOS? I have a few ogg music files and some large images that will presumably be bundled with the app even though the main collection object is blank.

This sounds really strange. If you take a look at a game such as Blossom Blast Saga it uses a lot of assets, and textures larger than 1024x1024 (but not larger than 2048x2048). Is the same game with that texture added running on any of your other iOS devices?

My iPhone 6 can handle up to 2048x1024 without problems, but I get a crash for 2048x2048.

Hmm, strange. Do you use texture profiles? (PVRTC in particular)
If not, see http://www.defold.com/manuals/texture-profiles for more info
These will help compress the textures for each platform, and is also something that Blossom Blast Saga uses.