Corrupted Error

See “This Application Has Been Corrupted Error” when launch my app on samsung galaxy s2.
Here is code:

local background = display.newImage( "back.png" )  
require "sprite"  
local sheet1 = sprite.newSpriteSheet( "anim.png", 70, 48 )  
local spriteSet1 = sprite.newSpriteSet(sheet1, 1, 9)  
sprite.add(spriteSet1, "jake", 1, 9, 500, 0 )   
local instance1 = sprite.newSprite( spriteSet1 )  
local xpos = display.contentWidth \* 0.5  
local ypos = 242  
local screenLeft = display.screenOriginX  
local screenRight = display.viewableContentWidth + display.screenOriginX  
instance1.x = xpos  
instance1.y = ypos  
local radius = 20  
local xspeed = 0  
local xdirection = 1  
instance1.xScale = .5  
instance1.yScale = .5  
k=0  
function touch (ev)  
if (ev.phase == "began" or ev.phase == "moved") then  
Xtouch = ev.xStart  
k = 1  
end  
if (ev.phase == "ended" or ev.phase == "cancelled") then  
k=0  
end  
end  
  
Runtime:addEventListener("touch", touch);  
  
local function animate(event)  
 if (k \> 0) then  
instance1:play()  
 xpos = xpos + ( xspeed \* xdirection );   
if (Xtouch \< display.contentWidth \* 0.5) then  
 xspeed = 5.0  
 xdirection = -1  
 instance1.xScale = - .5  
 if ( xpos \> screenRight - radius or xpos \< screenLeft + radius ) then  
 nstance1:stop()  
 instance1:pause()  
 instance1.xScale = - .5  
 end  
  
end  
if (Xtouch \> display.contentWidth \* 0.5) then  
 xspeed = 5.0  
 xdirection = 1  
 instance1.xScale = .5  
 if ( xpos \> screenRight - radius or xpos \< screenLeft + radius ) then  
 instance1.xScale = .5  
 instance1:stop()  
 end  
end  
 if ( xdirection \< 0 ) then  
 instance1.xScale = - .5   
 end   
 instance1:translate( xpos - instance1.x, ypos - instance1.y)  
end  
if (k \< 1) then  
instance1:pause()  
end  
end  
Runtime:addEventListener( "enterFrame", animate );  
instance1:prepare("jake")  
Runtime:addEventListener( "enterFrame", move );  

I’m new in Corona sdk. What i do wrong? [import]uid: 140468 topic_id: 24512 reply_id: 324512[/import]

This is probably the most frequently asked question on Planet Corona.

The #1 likely cause is you have a filename you are accessing with a different “case” than the file really exists, such as:
player = display.newImage(" P layer.png")

but in your folder it’s p layer.png

If that’s the entire code, you might want to look at anim.png and make sure its not bigger than 2048 pixels on any side. Make sure its not an 8bit png. [import]uid: 19626 topic_id: 24512 reply_id: 99212[/import]

No. All name not different. And all size smaller than 630 px [import]uid: 140468 topic_id: 24512 reply_id: 99214[/import]

May be that help. Here is debug in console, but i’m not understand it(((

Windows simulator build date: Dec 9 2011 @ 14:01:29

Runtime error
assertion failed!
stack traceback:
[C]: ?
[C]: in function ‘assert’
?: in function ‘getOrCreateTable’
?: in function ‘addEventListener’
?: in function ‘addEventListener’
…a sdk\sample code\gettingstarted\helloworld\main.lua:66: in mRuntime
error: assertion failed!
stack traceback:
[C]: ?
[C]: in function ‘assert’
?: in function ‘getOrCreateTable’
?: in function ‘addEventListener’
?: in function ‘addEventListener’
…a sdk\sample code\gettingstarted\helloworld\main.lua:66: in main chun
k
[import]uid: 140468 topic_id: 24512 reply_id: 99226[/import]

Using “Adb logcat” sholuld give you more information about what is wrong. If you developing for Android, you should be using Adb. [import]uid: 7559 topic_id: 24512 reply_id: 99227[/import]

Sorry but i’m noob and don’t know how to use logcat in Corona [import]uid: 140468 topic_id: 24512 reply_id: 99228[/import]

It’s sayIng the error is on line 66. I don’t see a “move” function defined so this may be the problem.

It’s always a good idea to try and run your app in the Corona simulator before running on a device to catch any errors. It’s much harder to debug on the device. [import]uid: 7559 topic_id: 24512 reply_id: 99229[/import]

Yeah!!! That’s work! Many thanks. Probably i copy this from other tutorial :slight_smile: [import]uid: 140468 topic_id: 24512 reply_id: 99232[/import]