[Resolved] Android build - Corona Crash - 509 Bus error: 10

I have successfully built an app for iOS and have it running on 2 devices (iPod Touch and iPad).

I need to build an APK for Android, but Corona is crashing out when doing so. I am able to access the build menu, but when the build begins Corona itself crashes.

Terminal outputs the following:

Copyright © 2009-2012 A n s c a , I n c .
Version: 2.0.0
Build: 2012.786
Invalid memory access of location 0x8 eip=0xd7ce
/Applications/CoronaSDK/Corona Terminal: line 9: 509 Bus error: 10 “$path/Corona Simulator.app/Contents/MacOS/Corona Simulator” $*
logout

[Process completed]
I am running on an iMac (OSX 10.7.3). I am using daily build 2012.786. The simulator works perfectly and it has been heavily tested on iOS devices and in the simulator (for iOS and Android devices).

It might be worth noting that I don’t think it’s actually trying to build the app before crashing. I have an iOS license for Corona, but not Android, so after waiting in the ‘trial build queue’ the app begins to build and then crashes immediately. It doesn’t appear to actually start the build itself though (when building on iOS you can see the build progress through each file as it’s added to the .app - I don’t get this before the crash). Corona appears to crash almost immediately after building should begin.

My build.settings file is almost default, with the androidPermissions object uncommented. The whole thing looks as follows:
[lua]-- Supported values for orientation:
– portrait, portraitUpsideDown, landscapeLeft, landscapeRight

settings = {

orientation = {
default = “portrait”,
supported = { “portrait”, }
},

iphone = {
plist = {
UIStatusBarHidden = false,
UIPrerenderedIcon = true, – set to false for “shine” overlay
–UIApplicationExitsOnSuspend = true, – uncomment to quit app on suspend

–[[
– iOS app URL schemes:
CFBundleURLTypes =
{
{
CFBundleURLSchemes =
{
“fbXXXXXXXXXXXXXX”, – example scheme for facebook
“coronasdkapp”, – example second scheme
}
}
}
–]]
}
},

– Android permissions

androidPermissions = {
“android.permission.INTERNET”,
},

}[/lua]

And lastly, I have researched the error on the forums and seen some mention of physics bodies. Although this appears to be related to a different bus error code I thought it might be worth mentioning that I am not using the physics engine.

Thanks [import]uid: 61422 topic_id: 27273 reply_id: 327273[/import]

Any help with this…? [import]uid: 61422 topic_id: 27273 reply_id: 111107[/import]

I’ve fixed this, I had to manually go through and comment every line of code out and then uncomment chunks, compiling every time. Time consuming.

The rogue code was:
[lua]display.setStatusBar( display.HiddenStatusBar )[/lua]

This hides the status bar in iOS. Using this on an Android app causes a bus error (tried on 3 different Daily Builds).

To be honest, I’m surprised at this. Surely the Android compiler would just ignore it? Obviously not - I think this should be added to the documentation.

I used the following to make it cross-platform compatible:
[lua]if( ( system.getInfo( ‘platformName’ ) == ‘Mac OS X’ ) or ( system.getInfo( ‘platformName’ ) == ‘iPhone OS’ ) ) then
display.setStatusBar( display.HiddenStatusBar )
end[/lua] [import]uid: 61422 topic_id: 27273 reply_id: 111140[/import]

Hey Mike,

Interesting stuff - I am sure I have build for Android in the past and kept the code to hide the status bar in there, though maybe I’m dreaming, I don’t do much with Android personally.

What build of Corona were you using, just OOI?

Peach :slight_smile: [import]uid: 52491 topic_id: 27273 reply_id: 111142[/import]

Daily build 786 and today’s daily build 828. Tried on OSX and a Windows 7 machine.

Pretty frustrating, but at least it’s sorted! [import]uid: 61422 topic_id: 27273 reply_id: 111147[/import]

Do you get an error in the terminal when you are hiding the status bar in your code on your PC?

(I’m thinking this may be worth bringing up in our next meeting - IIRC you get a warning but not a fail when building for Android on Mac with this code in place.) [import]uid: 52491 topic_id: 27273 reply_id: 111264[/import]