Error Application has been corrupted Android

Hi Folks,

I have a build that shows up fine in the emulator but when i port to a Galaxy Tab 10.1. (honeycomb) i get an error message saying "This application has been corrupted"

Any Ideas?

Thanks

That has happened to me too. Make sure your not requiring any .lua files that aren't necessary, like for instance require "main". That is something you don't want to do. Usually those errors are compile errors that are mistakes on your part. If you post the code, we can take a look and see if we can catch the problem.

Regards,
Jordan Schuetz
Ninja Pig Studios

I have checked all the casing and require

I have image files in folders like images/test/test.png

Will this make any difference?

Thanks

That actually may make a difference. I'm not sure, but if you don't own a copy of Corona, then you may have an old build that doesn't support pictures in separate folders. Try that and tell me what happens :)

Regards,
Jordan Schuetz
Ninja Pig Studios

Hi

I was able to find out where the problem was. How can i fix it?

If i comment out this code, the android package works fine.

1
2
3
4
5
6
house_glow = sprite.newSpriteSheetFromData( "images/Sprite_Source/house_glow.png", require("images/Sprite_Source/house_glow").getSpriteSheetData() )
 
local spriteSet = sprite.newSpriteSet(house_glow,1,10)
 
sprite.add(spriteSet,"house_glow",1,10,1000,0)
local spriteInstance = sprite.newSprite(spriteSet)

Are the file names exactly like that?

You can sometimes get away with case in the simulator but not on device.

this.png vs This.png can be the result of failure or success.

If you have adb installed. While running your app (keep usb cable plugged in) type this in terminal

adb logcat

that will report the error.

Danny,

I checked the case, it is fine.

so you got it working ?

No still the problem

Ok how large is your sprite sheet ? (1024x1024... larger?

spriteSourceSize = { width = 189, height = 215 },

189 x 215

11 frame animation

Try moving your sprite sheet and data file to the root directory and try again

OK, moving to the root worked. What happened here, are you saying that I have to keep all my animated PNGs and spritesheets at the root level? Why does the folder path not work?

Thanks

I had this problem a while ago.

Maybe this will fix?

1
2
3
4
5
6
local spritepath = system.pathForFile("images/Sprite_Source/house_glow.png", system.ResourceDirectory )
 
local spriteSourcePath =  system.pathForFile("images/Sprite_Source/house_glow", system.ResourceDirectory )
 
house_glow = sprite.newSpriteSheetFromData( spritepath, require(spriteSourcePath).getSpriteSheetData() )
 

I am getting an error bad argument #1 to require (string expected, got nil)

1
2
3
4
5
6
7
8
9
10
local spritepath = system.pathForFile("images/Sprite_Source/house_glow.png", system.ResourceDirectory )
 
local spriteSourcePath =  system.pathForFile("images/Sprite_Source/house_glow", system.ResourceDirectory )
 
house_glow = sprite.newSpriteSheetFromData( spritepath, require(spriteSourcePath).getSpriteSheetData() )
 
local spriteSet = sprite.newSpriteSet(house_glow,1,10)
 
sprite.add(spriteSet,"house_glow",1,10,1000,0)
local spriteInstance = sprite.newSprite(spriteSet)
views:1703 update:2012/2/7 8:40:54
corona forums © 2003-2011