Building an apk file for Android

I have created several little apk files so far - I have tried to build an apk file with the trial version (#894) and seem to be getting the following error message - “This application encountered a Lua error (see logs) or has been corrupted” on the device when the app is installed. The program seems to works within the simulator and builds OK (or at least no errors are reported).

Does anyone have an idea where I can go from here? [import]uid: 116086 topic_id: 32587 reply_id: 332587[/import]

Well for one, you need to get the Android Debug tools (adb) installed. Then with your device tethered you can from the command line run:

adb logcat

and see more information about what is causing the problem.

However 95% of the time if it runs in the simulator and doesn’t on device its because you are trying to access a file that has the wrong case in the name. The simulator ignores the case of a file name, so say you are loading an image:

obj = display.newImageRect(“MyImage.png”, 64, 64)

But the filename is really “myimage.png”. This will work find on the simulator and crash on the device because the device wants all filenames in the exact case you requested.

So images, audio, external .lua files (storyboard.gotoScene(), director.changeScene(), require(“something”)) all have to match.

It is above and by far the #1 reason why this problem happens. [import]uid: 19626 topic_id: 32587 reply_id: 129663[/import]

Well for one, you need to get the Android Debug tools (adb) installed. Then with your device tethered you can from the command line run:

adb logcat

and see more information about what is causing the problem.

However 95% of the time if it runs in the simulator and doesn’t on device its because you are trying to access a file that has the wrong case in the name. The simulator ignores the case of a file name, so say you are loading an image:

obj = display.newImageRect(“MyImage.png”, 64, 64)

But the filename is really “myimage.png”. This will work find on the simulator and crash on the device because the device wants all filenames in the exact case you requested.

So images, audio, external .lua files (storyboard.gotoScene(), director.changeScene(), require(“something”)) all have to match.

It is above and by far the #1 reason why this problem happens. [import]uid: 19626 topic_id: 32587 reply_id: 129663[/import]