Game Development Community

iPad Simulation and Failing to Launch Suddenly [Resolved Mostly]

by Charlie Patterson · in iTorque 2D · 02/25/2013 (12:59 pm) · 1 replies

Hi. Anyone with a bit more experience that could help here?

The short version is that I get the following error often when trying to run my game in iT2D as iPad simulated:

"Failed to launch simulated application: Unknown error."

Have others dealt with this erro and know a few things to look for? Or how about a way to see a *little* more information about the error. :)

Once the error shows up, it seems to stay until I trash my project, copy a new one and go again. But I'm just not sure. And that sucks if so. I'm not an iOS or Xcode programmer really so it's disturbing to not know when it will crop up and bite me.

=========

The longer version has a few more details about how I got here. :)
I've been programming T2D (not iT2D) for a year on windows and Mac (Mostly Windows but porting code to Mac has gone fine.) I do lots of TorqueScript and a decent amount of C++. I'm now porting over to iT2D for the iphone version. (Unfortunately my game isn't through but it's time to expand my knowledge for the future of the project.) I've rearranged lots of stuff, changed file paths, etc.

When I launch into an iPad simulator, from XCode, I get the above error. Arrooooo! Sad dog. When I compile and run the example projects, they seem to work fine. When I steal their buildFiles and work with those, that seems to do much better. When I add a build step to copy another directory to the target ("resources") that seems OK. Dum da dum, fixing issues and playing around. Getting closer. What's that strange white rectangle over half the screen? No matter. Why doesn't my mouse work? Hmm. Gotta switch to "touch" calls. Lalala. Crash! And from then on nothing seems to fix it.

Stackoverflow is useless on this. Everyone seems to think rebooting, clearing cache, etc, etc. may work. However, I can still run example projects without doing those. (And those ideas don't work anyway.)

Thanks for any help.

#1
02/26/2013 (12:59 pm)
Heh. Well that was a bear. And the hint was right in my description.

It appears that you should NOT include a directory named "resources" in an iPad app! Unfortunately the code for iT2D (and T2D) allow you to keep a high-level directory named, um, "resources" that holds asset packs. I noticed the code to utilize this is in iT2D's system scripts, probably a leftover from T2D. So I used it. Oops. :) I guess I'm the first?

I then included this "resources" dir in my xcode project by telling it to copy the "resources" directory into the app bundle. This seemed to work for a go or two, though that may be my imagination. The crash is immediate and has no log output.

By renaming the T2D "resources" directory to something like "sharedResources," and changing the system scripts to look for the new name instead, you can continue to use the asset pack directory without iPad having a hissy.

Before running again you must *clean* the project (or hand-remove the old "resources" from the iTorqueGame app bundle).

I'm back to my state 2 days ago.

So how did I find this? Barely! I was digging in the xcode project file, itself being a bundle of things, and I noticed it kept commenting like the following: "moved main.cs to resources". Everything was getting moved to resources in the comments. Hmm. That's weird. Apple must use that name to mean the "master bundle" or something.