★ TouchArcade needs your help. Click here to support us on Patreon.

Help! App won't run on my device

03-13-2009, 04:35 AM
#1
Joined: Sep 2008
Location: Birmingham, UK, dull corner of the world
Posts: 2,367
Help! App won't run on my device

I have used the Development Provisioning Assistant to go through the setup needed to get my app running on my device. It went through settings up the App ID, Keychain access etc etc, and in the end in Organizer I have a provisioning profile listed on my Touch with that same profile listed underneath and the Touch listed under Included Devices.

It all went so swimmingly, until the assistant told me to select the device at the top instead of the simulator and click Build. The app has gone onto my device fine. But when it runs automatically it stays on the splash screen I created instead of going to the main menu. When I quit it, and just try tapping the game icon on the home screen, the splash screen comes up for a couple of seconds, then it returns to the Home screen again!

What's going on? When I run my app in the simulator it works perfectly.
Is there anything I can check?

One thing I have noticed is at the bottom left of the Xcode window, it says "GDB: Running" while the app loads, then it says "GDB: Interrupted" at the point I assume it crashes. What is this?

[UPDATE]
I ran the console and it showed this at the point where "GDB: Interrupted" shows...

2009-03-13 10:03:08.746 FoJ[230:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
2009-03-13 10:03:08.790 FoJ[230:20b] Stack: (
808221155,
806100816,
808035743,
808035647,
812215263,
812214747,
16755,
816623612,
818122640,
818130772,
816625560,
816626608,
816627024,
9203,
816115500,
816152052,
812205481,
807837071,
807834407,
827752032,
816118388,
816157144,
8381,
8244
)
terminate called after throwing an instance of 'NSException'
(gdb)


I don't understand why I am having this issue (or even WHERE the issue is) when it runs perfectly fine in the simulator.

Last edited by wastedyuthe; 03-13-2009 at 05:07 AM.
03-13-2009, 05:33 AM
#2
Joined: Jan 2009
Location: Italy
Posts: 1,452
gdb should be the debugger.

take into account that I have no experience with the iphone SDK, but could that be that it doesn't find some file?

03-13-2009, 06:00 AM
#3
Joined: Sep 2008
Location: Birmingham, UK, dull corner of the world
Posts: 2,367
I have looked at my code more, and recognized the command "InitFileURLWithPath" bit as part of my sound effects and music code. I am using the AVFoundation Framework, and use this to set up my button click sound effect as well as other similar ones for music and other sound effects.
This works perfectly in the simulator, but just to test (after backing up the project) I removed all instances of audio code from my project, so it is entirely audio free- AND IT PLAYS! Another issue I have is some of the sprites aren't displaying in the actual game itself, yet they do so in the simulator.
Someone please help before I just move my whole project to the trash and forget the whole thing.

Last edited by wastedyuthe; 03-13-2009 at 09:30 AM.
03-13-2009, 06:09 AM
#4
Joined: Jan 2009
Location: Italy
Posts: 1,452
again, nothing iphone-oriented but just general programming thoughts - it seems it's not able to access to some resources (audio, sprites) on the device, I don't know if it's related to absolute-relative paths issues or something like that, but I don't think it will be hard to solve. I'm sure you'll shortly receive more professional help that will solve the thing
03-13-2009, 07:37 AM
#5
First port of call is to 'Clean All' and then build again.

If you still have problems it looks like your resource files aren't being copied across, check the copy phases etc. and make sure everything you require is.

Didev Studios || Twitter || YouTube || Facebook
Releases
GeoSnake || Bugz || Review Scraper (Open Source)
03-13-2009, 07:45 AM
#6
Joined: Sep 2008
Location: Birmingham, UK, dull corner of the world
Posts: 2,367
Quote:
Originally Posted by InsertWittyName View Post
First port of call is to 'Clean All' and then build again.

If you still have problems it looks like your resource files aren't being copied across, check the copy phases etc. and make sure everything you require is.
I think you are right about the resource files. But first, how do I 'clean all' and what does that do exactly? This is my very first app and am still learning.

Thanks.

[EDIT] Ahh- found the Clean All button in the Customize Toolbar option for Xcode. Trying it.

[UPDATE] The Clean All option has forced it to install all the resources again and I have all my sprites displayed as they should be, which is a great improvement. Now I just need to revert back to the version of my project with the audio and try and get that to work. Also, even without the audio, I can play my game but it crashes after 10-20 seconds play- but that's a hurdle I will tackle AFTER sorting out the audio if I can. Thanks for your help so far.

[UPDATE TWO] Done it! Well, I've at least got the audio working. I checked the audio players and found a discrepancy in the file name reference. It is now playing audio perfectly (although a little low volume, but I can fix that). Now I need to fix one last thing- the crashing while the game plays. When I have that fixed, I will definitely need to work on making the game faster. It is quite slow on the Touch compared to lightning fast on the simulator. But first things first- fixing the crash.

Last edited by wastedyuthe; 03-13-2009 at 08:26 AM.
03-13-2009, 09:36 AM
#7
Joined: Sep 2008
Location: Birmingham, UK, dull corner of the world
Posts: 2,367
With the games only problem now of crashing during gameplay, can someone please tell me what the console means when it says "Program exited with status value:101."?
This is, of course, what it says when the game crashes. There is no other information it gives me now, as to why it is crashing, so this is a tough one to figure out.
03-13-2009, 09:58 AM
#8
The crash that you are getting is indeed due to a missing file. I ran into a similar problem a few months ago, and the solution for me was to check my capitalization. The simulator doesn't care if something is capitalized or not, but the iDevice does.
03-13-2009, 10:04 AM
#9
Joined: Sep 2008
Location: Birmingham, UK, dull corner of the world
Posts: 2,367
Thanks Andrew. I had that issue with one or two of my sprites I know, and I had the same issue with one of the sound effects (the button click), which is why I had both of those issues and have now solved them. I will look into the sprites used in the game to make sure they are all correctly named and make sure the reference to them is also exactly the same- case sensitive. I will report back later (on my way home from work in a minute).
03-13-2009, 03:06 PM
#10
Joined: Jan 2009
Posts: 22
Quote:
Originally Posted by wastedyuthe View Post
[B]2009-03-13 10:03:08.746 FoJ[230:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
2009-03-13 10:03:08.790 FoJ[230:20b] Stack: (
808221155,
806100816,
808035743,
808035647,
812215263,
812214747,
16755,
816623612,
818122640,
818130772,
816625560,
816626608,
816627024,
9203,
816115500,
816152052,
812205481,
807837071,
807834407,
827752032,
816118388,
816157144,
8381,
8244
)
If you get a stack trace like this, you can translate the numbers into lines of code by typing the following in the Console:

info symbol 16755

where 16755 is the first relatively small number in the list. Other useful Console commands are "bt" to print out the stack trace and "po varName" where varName is the name of a variable. po is very useful for seeing the contents of a NSDictionary.