FusePowered

[Resolved] App crashing when building in XCode Simulator

18 replies [Last post]
RoyMan
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 5 Apr 2011

Sorry if this is another repost, I think it got swept away with the forum issues yesterday as I cannot find the original post.

I am having an issue when I go to build my app using the XCode simulator. It runs fine in Coronas Simulator but it crashes immediately after opening in the XCode simulator. When the build is done, it turns the simulator to landscape (which is what I have my app setting on) then the screen goes black for a second, and then it flips back to portrait and closes my app returning to the iOS home screen. When I check in the console this is all I get:

1
2
4/19/12 2:44:37 PM      com.apple.launchd.peruser.501[94]       (UIKitApplication:com.yourcompany.Smashing Cans[0x3501][2325]) Exited with exit code: 1
4/19/12 2:44:37 PM      SpringBoard[2304]       Application 'Smashing Cans' exited abnormally with exit status 1

I have went back into my code and changed everything to make sure none of my requires are missing parenthesis and all my .lua files are in the main directory, I am not using any subdirectories except for images.

I should also note that this error happens whenever I build any app from the corona simulator into XCode simulator. I tried building the Fishies app that comes with Corona as well as other Sample code apps and I always get the same issue (adjusts orientation, black screen, readjusts orientation if it changed, then back to iPhone home screen.) If anyone could help it would be greatly appreciated.

Replies

peach pellen
User offline. Last seen 1 year 49 weeks ago. Offline
Alumni
Joined: 12 Apr 2011

Hey Roy,

I saw this and replied yesterday, though yes perhaps it got lost with all the forum stuff going on.

This obviously isn't right - so you can you let me know what version of OSX, Corona and of Xcode you are currently using, please? :)

Peach

RoyMan
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 5 Apr 2011

Corona version: Version 2011.704 (2011.12.8)

XCode version: Version 4.3 (238.2)

OSX version: Mac OS X 10.6.8 (10K549)

Thanks again for helping out with my stupid problems Peach. I'm sure i'm the only one who runs into these lol

peach pellen
User offline. Last seen 1 year 49 weeks ago. Offline
Alumni
Joined: 12 Apr 2011

Hrm.

Xcode 4.3 running on 10.6.8 - did you get that on there using a "workaround"? IIRC 4.3 is for Lion+.

Any chance of reverting to 4.2 for Snow Leopard and seeing if the issue continues?

I can ask around about this on Monday but that is the first thing I'd be inclined to suspect.

Let me know and we will go from there but obviously it's a big problem if sample code is crashing the simulator, that should not happen - even if it somehow is only you having the issue that doesn't make it a stupid problem, just a more annoying one (for you) as we haven't got an answer yet.

Peach ;)

RoyMan
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 5 Apr 2011

wait, I'm sorry Peach my XCode is version Version 4.0.1 Build 4A1006. The iOS simulator when I build my projects version is the 4.3 version.

peach pellen
User offline. Last seen 1 year 49 weeks ago. Offline
Alumni
Joined: 12 Apr 2011

Hmmmm, I wonder if updating Xcode might help, then. That is a little old. There's version 4.2 available for Snow Leopard - want to update and let me know if it helps?

I wont be able to have a good talk about this with anyone until Monday morning so obviously whatever we can do in the meantime that might help is worth a shot, IMHO ;)

RoyMan
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 5 Apr 2011

I have not been able to find how to revert back to XCode 4.2, so I haven downloaded the Snow Leopard version from the apple dev site and will try and revert once it is downloaded. I will EDIT when I try this.

EDIT: okay so I cannot revert back to XCode 4.2 for snow leopard for some reason. I have spent the past 2+ hours researching on how to do it and it just doesn't work. I am a paid developer with a current account and it is not available in the developer download section for me. I am trying to download XCode 4.2 for Lion OSX and seeing if it can automatically revert but I doubt it.

peach pellen
User offline. Last seen 1 year 49 weeks ago. Offline
Alumni
Joined: 12 Apr 2011

Hey,

First up - you wont revert, you'll update. You are running 4.0.1 and 4.2 is newer ;)

How to update;
- Make sure you are logged in
- go here: https://developer.apple.com/devcenter/ios/index.action

When logged in 4.2 for Snow Leopard will appear under the version for Lion.

Let me know how that goes :)

RoyMan
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 5 Apr 2011

I got it to work and to update and finally the simulator after build worked! Although this is now what I get:

Photobucket

The top simulator is the iOS XCode simulator and the bottom simulator is Corona. I'm having a bad Sunday.

peach pellen
User offline. Last seen 1 year 49 weeks ago. Offline
Alumni
Joined: 12 Apr 2011

Oh great, OK, so updating did work! Excellent.

For the was the screen looks can you please show me your config.lua contents? (in < lua > tags.)

Peach :)

RoyMan
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 5 Apr 2011

Hey Peach. The problem is that I had my scale set to "none." I'm not sure if this was correct but I changed it from:

1
2
3
4
                fps = 60,
                width = 960,
                height = 640,
                scale = "none",

To this:

1
2
3
4
                fps = 60,
                width = 480,
                height = 320,
                scale = "letterbox",

So now I have to go back and resize all my images and work with different positions and so on. Tedious, yes, but so far it has been working.

Danny
User offline. Last seen 44 weeks 4 days ago. Offline
Staff
Joined: 17 Aug 2011

Hey Roy. The width/height parameters are based on the phone's size in portrait mode.

So your width/height would be

width = 320,
height = 480,

peach pellen
User offline. Last seen 1 year 49 weeks ago. Offline
Alumni
Joined: 12 Apr 2011

Hey Roy, as Danny said about width and height will always be based on the device in portrait mode - lots of people trip up on that at first ;)

Once you modify that and fix zoom (which I can see you have) would love to hear how you get on.

Marking this as resolved as the original issue is indeed resolved.

Peach :)

RoyMan
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 5 Apr 2011

Would I have to switch the width and height? The problem is, is that I am almost done with my app and when I do make the switch, everything gets messed up ( again :( ), but it works when I leave it as is.

peach pellen
User offline. Last seen 1 year 49 weeks ago. Offline
Alumni
Joined: 12 Apr 2011

Sorry but yes, you really must - you will get headaches later on if so.

I know it is a bit of a pain but even if your app is fairly large it shouldn't take too long and in the end it WILL be worth it.

RoyMan
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 5 Apr 2011

Just to verify, my app is always supposed to be in landscape mode with no option to move to portrait even if the phone is turned upright. So I would still make this change:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--what I have now
application = 
{
        content = 
        {
                fps = 60,
                width = 480,
                height = 320,
                scale = "letterbox",
                
                imageSuffix =
                {
                        ["@2x"] = 2
                },
        },
}

To this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
application = 
{
        content = 
        {
                fps = 60,
                width = 320,
                height = 480,
                scale = "letterbox",
                
                imageSuffix =
                {
                        ["@2x"] = 2
                },
        },
}

It seems odd although, I am just a beginner and still trying to understand the crazy world of programming!

peach pellen
User offline. Last seen 1 year 49 weeks ago. Offline
Alumni
Joined: 12 Apr 2011

Yes.

I know it seems odd but yes - the width and height should be the REAL width and height, turning something on its side doesn't change where the top of it normally is, if that makes it any clearer.

Like when you lay down on your side your head is still your head and your feet are still your feet, and your height remains the same ;)

RoyMan
User offline. Last seen 2 years 9 weeks ago. Offline
Joined: 5 Apr 2011

Alright, that makes a lot of sense Peach, thanks! I was thinking that the width was setting the x total value and the height was setting the y's total value. Its is important to know that up and down does not mean top and bottom, which is the difference I did not see. I appreciate all your help on these matters, Peach, you've been a great help! :)

peach pellen
User offline. Last seen 1 year 49 weeks ago. Offline
Alumni
Joined: 12 Apr 2011

No worries Roy, I know this is a stumbling point for lots of new devs - I did the same thing early on ;)

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.