[Android] Application Corrupted

Hi, I’m testing more than 1 app on an Android device, but just the firs app that I open works, when I tried to open the second or third I have the following message… “This application has been corrupted”

I’m on a Mac with 2012.840 [import]uid: 71202 topic_id: 30051 reply_id: 330051[/import]

Have you tried to delete the application and download it again. Sometimes if there is a hiccup at the site or on your internet connection it can cause an issue with the download. If the first one went through then you had a hiccup during the other two downloads that would explain why works and the others don’t. [import]uid: 49863 topic_id: 30051 reply_id: 120335[/import]

The error message “This application has been corrupted” typically means that you have a Lua runtime error in your code. If you look at the Android log on your device, then it should provide clues on where it went wrong. You can view the log via “adb logcat” or “ddms” tools that is included with the Android SDK.

If you use the newest daily build, then we’ve now set it up so that if you build with the debug keystore, the log will provide more detailed information such as a Lua stack trace. This information is stripped out when you use your own keystore. [import]uid: 32256 topic_id: 30051 reply_id: 120339[/import]

Have you tried to delete the application and download it again. Sometimes if there is a hiccup at the site or on your internet connection it can cause an issue with the download. If the first one went through then you had a hiccup during the other two downloads that would explain why works and the others don’t. [import]uid: 49863 topic_id: 30051 reply_id: 120335[/import]

The error message “This application has been corrupted” typically means that you have a Lua runtime error in your code. If you look at the Android log on your device, then it should provide clues on where it went wrong. You can view the log via “adb logcat” or “ddms” tools that is included with the Android SDK.

If you use the newest daily build, then we’ve now set it up so that if you build with the debug keystore, the log will provide more detailed information such as a Lua stack trace. This information is stripped out when you use your own keystore. [import]uid: 32256 topic_id: 30051 reply_id: 120339[/import]

Most often people have been saying it is often caused by files (.lua, images, sounds) having different capitalization than what you listed in the code (ie: “mainMenu” in your code is trying to refer to your file named mainmenu.lua). Wrong file location would do the same. Or maybe a file can’t be located for other reasons. For instance, I got the error because I didn’t list a filename in a newImageRect. I just put quotes (""), and added a fill color, with the intention of going back and adding an image filename later. The simulator ran everything fine, it just used the color and treated it like a regular rectangle. BUT the build didn’t run at all on the device, it went immediately to that corruption error…

[import]uid: 167583 topic_id: 30051 reply_id: 121036[/import]

prolific brings up a good point. You could have a file casing issue. That is, your code is trying to load a file name that does not match the exact casing of the file. You see, the file systems on Mac (by default) and Windows are not case sensitive and allow you to load files with the a casing mismatch. However, the file systems on iOS and Android are case sensitive, and will fail to load the files. Your code is likely not set up to handle when files fail to load, such as display.newImage() returning nil, which would lead to a Lua runtime error… thus causing this “application has been corrupted” error.

So, the simple solution is to go through all of the file names in your code and make sure that they exactly match the file name casing that they are trying to load. [import]uid: 32256 topic_id: 30051 reply_id: 121059[/import]

Most often people have been saying it is often caused by files (.lua, images, sounds) having different capitalization than what you listed in the code (ie: “mainMenu” in your code is trying to refer to your file named mainmenu.lua). Wrong file location would do the same. Or maybe a file can’t be located for other reasons. For instance, I got the error because I didn’t list a filename in a newImageRect. I just put quotes (""), and added a fill color, with the intention of going back and adding an image filename later. The simulator ran everything fine, it just used the color and treated it like a regular rectangle. BUT the build didn’t run at all on the device, it went immediately to that corruption error…

[import]uid: 167583 topic_id: 30051 reply_id: 121036[/import]

prolific brings up a good point. You could have a file casing issue. That is, your code is trying to load a file name that does not match the exact casing of the file. You see, the file systems on Mac (by default) and Windows are not case sensitive and allow you to load files with the a casing mismatch. However, the file systems on iOS and Android are case sensitive, and will fail to load the files. Your code is likely not set up to handle when files fail to load, such as display.newImage() returning nil, which would lead to a Lua runtime error… thus causing this “application has been corrupted” error.

So, the simple solution is to go through all of the file names in your code and make sure that they exactly match the file name casing that they are trying to load. [import]uid: 32256 topic_id: 30051 reply_id: 121059[/import]