This Application Has Encountered A Lua Error(See Logs) Or Has Been Corrupted

I recently tried to build my app for android. The program works in the simulator but get the error in the title when I run it on my tablet. BTW, I can build and run the sample apps, they work fine. Here is all the code for my game (I have just made the Intro Scene)

I am using the Lua Glider IDE if that matters at all (IDK, I’m very new to corona)

road = display.newImage ("road.png") road2 = display.newImage ("road.png") road3 = display.newImage ("road.png") roadline = {} roadline[1] = display.newImage("Yellowline.jpg") roadline[2] = display.newImage("Yellowline.jpg") roadline[3] = display.newImage("Yellowline.jpg") roadline[4] = display.newImage("Yellowline.jpg") roadline[5] = display.newImage("Yellowline.jpg") masterline = display.newImage ("Yellowline.jpg") masterline.y = 0 masterline.x = 160 masterline.xScale = .05 masterline.yScale = .2 logo = display.newImage ("Logo.png") logo.alpha = 0 logo.x = 160 logo.xScale = 10 logo.yScale = 10 function sound() start = display.newImage("instructions.png") start.xScale = 10 start.yScale = 10 start.x = 160 start.y = 300 start.alpha = 0 transition.to(start,{xScale = 1, yScale = 1,alpha = 1,delay = 1000 }) end transition.to (logo, {alpha=1, time=1000,delay= 1000, x = 160,xScale = 1, yScale = 1,y = 200, onComplete = sound}) --sounds --var road.y = 100 road2.y = -500 road3.y = -1000 --make the road --roadline setup road.xScale = 1 roadline[1].xScale = .05 roadline[2].xScale = .05 roadline[3].xScale = .05 roadline[4].xScale = .05 roadline[5].xScale = .05 roadline[1].yScale = .2 roadline[2].yScale = .2 roadline[3].yScale = .2 roadline[4].yScale = .2 roadline[5].yScale = .2 roadline[1].x = 160 roadline[2].x = 160 roadline[3].x = 160 roadline[4].x = 160 roadline[5].x = 160 roadline[1].y = masterline.y + 150 roadline[2].y = roadline[1].y + 150 roadline[3].y = roadline[2].y + 150 roadline[4].y = roadline[3].y + 150 roadline[5].y = masterline.y -150 --end roadline setup roadline.yScale = .2 roadline.xScale = .05 --FUNCTION MOVE ROAD------------------------------------ function MoveRoad() --lines of road masterline.y = masterline.y + 10 roadline[1].y = roadline[1].y + 10 roadline[2].y = roadline[2].y + 10 roadline[3].y = roadline[3].y + 10 roadline[4].y = roadline[4].y + 10 roadline[5].y = roadline[5].y + 10 --actual road textures road.y = road.y + 10 road2.y = road2.y + 10 road3.y = road3.y + 10 --moving roads to top of screen if road.y \> 1000 then road.y = -1000 end if road2.y \> 1000 then road2.y = -1000 end if road3.y \> 1000 then road3.y = -1000 end --line movement if roadline[1].y \> 290 then masterline.y = 0 roadline[1].y = masterline.y + 150 roadline[2].y = roadline[1].y + 150 roadline[3].y = roadline[2].y + 150 roadline[4].y = roadline[4].y + 150 roadline[4].y = roadline[4].y + 150 roadline[5].y = masterline.y - 150 end end Runtime:addEventListener("enterFrame", MoveRoad )

You need to be able to see the console log from your device using the “adb logcat” command from your terminal/command line.  This will show any errors you are getting. 

The two most common causes of this error is either an error in your build.setttings file (which the Corona Simulator doesn’t use) or you have a case sensitivity problem.  Filenames are not case sensitive of the simulator but they are on device.  Thus if “Yellowline.jpg” is really “yellowline.jpg” in the folder, it will error.  Check all your file names.

Since you’re using Glider, when you are building the project for testing on a device try using the ‘build’ button (the hammer icon) rather than the ‘run’ icon (the green arrow).  ‘Run’ and ‘Debug’ in Glider create extra lua files that seem to cause problems on device builds. 

@chasemorell - The most common reasons for me to get this error are:

  1. Used wrong case when naming file - Corona is case-sensitive on devices, but on the Windows simulator you won’t notice a case mistake. (EX: Edo.jpg refererred to as edo.jpg would cause this error).

  2. Accessing a file that is not present.  - Trying to read a file that is not present.  Especially a temporary file you may have at some prior time created in the ‘documents’ directory.

  3. Trying to write to a file in the resource directory.

  4. More I’m sure…

Since you aren’t doing any file reading/writing in your code I suggest examining the names of all the PNG and JPG files versus how you name them in code.

-Ed

PS - I need to read others’ posts notes carefully.  Rob gave the same advice re: naming. :slight_smile:

Yep. I had this problem once as well. It’s because Glider adds - require “CiderDebugger”; at the top of main.lua to enable debugging in the IDE. Glider rocks, by the way.  :slight_smile:

You need to be able to see the console log from your device using the “adb logcat” command from your terminal/command line.  This will show any errors you are getting. 

The two most common causes of this error is either an error in your build.setttings file (which the Corona Simulator doesn’t use) or you have a case sensitivity problem.  Filenames are not case sensitive of the simulator but they are on device.  Thus if “Yellowline.jpg” is really “yellowline.jpg” in the folder, it will error.  Check all your file names.

Since you’re using Glider, when you are building the project for testing on a device try using the ‘build’ button (the hammer icon) rather than the ‘run’ icon (the green arrow).  ‘Run’ and ‘Debug’ in Glider create extra lua files that seem to cause problems on device builds. 

@chasemorell - The most common reasons for me to get this error are:

  1. Used wrong case when naming file - Corona is case-sensitive on devices, but on the Windows simulator you won’t notice a case mistake. (EX: Edo.jpg refererred to as edo.jpg would cause this error).

  2. Accessing a file that is not present.  - Trying to read a file that is not present.  Especially a temporary file you may have at some prior time created in the ‘documents’ directory.

  3. Trying to write to a file in the resource directory.

  4. More I’m sure…

Since you aren’t doing any file reading/writing in your code I suggest examining the names of all the PNG and JPG files versus how you name them in code.

-Ed

PS - I need to read others’ posts notes carefully.  Rob gave the same advice re: naming. :slight_smile:

Yep. I had this problem once as well. It’s because Glider adds - require “CiderDebugger”; at the top of main.lua to enable debugging in the IDE. Glider rocks, by the way.  :slight_smile:

Hello Everyone,

Glider version 1.9.02 will fix this issue once and for all. If the device is trying to run in debug mode a message will pop up alerting you about it. Please use the “build” button (with the hammer) to ensure the debug headers are removed from your app. 

Regards,

M.Y. Developers

Hello Everyone,

Glider version 1.9.02 will fix this issue once and for all. If the device is trying to run in debug mode a message will pop up alerting you about it. Please use the “build” button (with the hammer) to ensure the debug headers are removed from your app. 

Regards,

M.Y. Developers