Console not showing errors anymore?

For some reason my app won’t run and the console is no longer showing me any errors. I’ve tried openeing an if statement and not closing it to test and it just fails to run the app but the console shows nothing wrong. It used to work just fine, any ideas?

@dmglakewood,

Give us details.  Windows 7, Windows 8, OS X v?.??, What build of Corona?  

-Ed

Windows 7 64 bit

Build 1114

I noticed that it’s only in 1 app that I’m having this issue. It’s also the same app that is giving me issues building for amazon. All the other apps build for amazon and show console errors. I’m assuming it has to do with my app, but I have no idea where to start to try and debug this.

To be clear, you are saying that you no longer get any errors in the console.  Do you still get messages, or is your console completely blank?

Have you made ANY changes to your OS lately, including new apps installed or removed, new drivers, etc.  Check your Windows update log.  Maybe it did something quietly.  

Although, I am having trouble imagining what could block console output, but you are experiencing it, so let me suggest some very simple experiments.

  1. Temporarily remove (set aside) config.lua.

  2. Check to see if you get console errors (and/or messages now).

  3. Temporarily remove (set aside) build.settings

  4. Check to see if you get console errors (and/or messages now).

  5.  Open main.lua and put this line of code at the very top.

    print( "hello world 

  6. Try running this now and you should see something like this:

http://downloads.roaminggamer.com/blogging/corona_130517/help/ex2.png

  1. Move the line to the very bottom of the file.

  2. Try running it again.  

Still getting the error/dialog?

  • YES: Hmmm.  This seems like the console is working fine, you might need someone to look direclty at your entire project.
  • NO: Something in your code preventing errors from loggging.  Try the following less than elegant test.

10. Comment out the the entire body main.lua like this:

-- Very top of file --[[--]] -- Very end of file 
  1. At the top of the file, place code that will cause an error.

    print( "hello world  – Very top of file --[[  

  2. Try running this now and you should see something like this:

http://downloads.roaminggamer.com/blogging/corona_130517/help/ex2.png

  1. Now slowly line by line expose parts of your code by moving the 'error code and the top multi-line comment block down through main.lua.  The goal here is to expose your original code line by line till you stop seeing errors.  When this happen, you will have identified the offending code or more likely require() call.  Now you have to dig into that code… This could take a while.

Note: As an alternative to all this, you might try using an IDE and seeing if it detects something.  (See 3rd party tools page for IDEs).

Okay so when I remove the build.settings and the config.lua the console doesn’t say anything and the app looks funny but that makes sense as the sizes would be all messed up.

When I put the broken print statement at the top or bottom or anywhere in the main.lua it does throw an error. However when I put the same broken print statement in an included file it no longer throws an error on any of the included pages. Is there something I should be looking at with the included pages?

Edit: Okay I found the bug that was causing the issue in my app and the app is working perfectly. Howerver I still can’t get any errors to display in the console on included files. They will only show if they are caused in the main.lua file

I don’t think he meant for the print statement to be broken.  Can you do the experiment with a non-broken print statement?

I doubt that config.lua and build.settings are guilty.  What is more likely the case is something is turning your prints off, like using one of the IDE’s that wants the errors redirected to them instead of the console window.

Also make sure that your Corona SDK preferences has the “Show runtime errors” checked and that you’re not doing any Runtime:addEventListeners() that are trapping errors.

All print statements work just fine in all the included files as well as the main.lua

I don’t use an IDE I just use sublime text editor. Also all my errors are working in other apps.

All my other apps work fine, but for some reason if I have an error in any of the required files in my main.lua it will not alert me of the error. If I create the same error inside the main.lua it will alert me just fine.

I do have the “Show runtime errors” ticked in the options. The only listeners I have on the Runtime is key and enterframe. Can either of those be suppressing the errors?

I think you’ll need someone to look at your code at this point.  Remote, time-lapsed, eyes-off debugging can only do so much. 

Sorry.

I struggled with this phenomenon (runtime errors in libraries not being reported in simulator in many of my apps, just silently dying).  After commenting out code one line at a time, I found that it was caused by me using a global variable called “_G.debug”

I renamed my variable to _G.mydebug, and runtime errors are once again reported in the simulator

I don’t claim to know why this fixed the problem, but it definitely did.

That is a great find @scott0!!!  I tested it and indeed, having a global _G.debug kills the messages.  I’ll ask the engineers about this.

@dmglakewood,

Give us details.  Windows 7, Windows 8, OS X v?.??, What build of Corona?  

-Ed

Windows 7 64 bit

Build 1114

I noticed that it’s only in 1 app that I’m having this issue. It’s also the same app that is giving me issues building for amazon. All the other apps build for amazon and show console errors. I’m assuming it has to do with my app, but I have no idea where to start to try and debug this.

To be clear, you are saying that you no longer get any errors in the console.  Do you still get messages, or is your console completely blank?

Have you made ANY changes to your OS lately, including new apps installed or removed, new drivers, etc.  Check your Windows update log.  Maybe it did something quietly.  

Although, I am having trouble imagining what could block console output, but you are experiencing it, so let me suggest some very simple experiments.

  1. Temporarily remove (set aside) config.lua.

  2. Check to see if you get console errors (and/or messages now).

  3. Temporarily remove (set aside) build.settings

  4. Check to see if you get console errors (and/or messages now).

  5.  Open main.lua and put this line of code at the very top.

    print( "hello world 

  6. Try running this now and you should see something like this:

http://downloads.roaminggamer.com/blogging/corona_130517/help/ex2.png

  1. Move the line to the very bottom of the file.

  2. Try running it again.  

Still getting the error/dialog?

  • YES: Hmmm.  This seems like the console is working fine, you might need someone to look direclty at your entire project.
  • NO: Something in your code preventing errors from loggging.  Try the following less than elegant test.

10. Comment out the the entire body main.lua like this:

-- Very top of file --[[--]] -- Very end of file 
  1. At the top of the file, place code that will cause an error.

    print( "hello world  – Very top of file --[[  

  2. Try running this now and you should see something like this:

http://downloads.roaminggamer.com/blogging/corona_130517/help/ex2.png

  1. Now slowly line by line expose parts of your code by moving the 'error code and the top multi-line comment block down through main.lua.  The goal here is to expose your original code line by line till you stop seeing errors.  When this happen, you will have identified the offending code or more likely require() call.  Now you have to dig into that code… This could take a while.

Note: As an alternative to all this, you might try using an IDE and seeing if it detects something.  (See 3rd party tools page for IDEs).

Okay so when I remove the build.settings and the config.lua the console doesn’t say anything and the app looks funny but that makes sense as the sizes would be all messed up.

When I put the broken print statement at the top or bottom or anywhere in the main.lua it does throw an error. However when I put the same broken print statement in an included file it no longer throws an error on any of the included pages. Is there something I should be looking at with the included pages?

Edit: Okay I found the bug that was causing the issue in my app and the app is working perfectly. Howerver I still can’t get any errors to display in the console on included files. They will only show if they are caused in the main.lua file

I don’t think he meant for the print statement to be broken.  Can you do the experiment with a non-broken print statement?

I doubt that config.lua and build.settings are guilty.  What is more likely the case is something is turning your prints off, like using one of the IDE’s that wants the errors redirected to them instead of the console window.

Also make sure that your Corona SDK preferences has the “Show runtime errors” checked and that you’re not doing any Runtime:addEventListeners() that are trapping errors.

All print statements work just fine in all the included files as well as the main.lua

I don’t use an IDE I just use sublime text editor. Also all my errors are working in other apps.

All my other apps work fine, but for some reason if I have an error in any of the required files in my main.lua it will not alert me of the error. If I create the same error inside the main.lua it will alert me just fine.

I do have the “Show runtime errors” ticked in the options. The only listeners I have on the Runtime is key and enterframe. Can either of those be suppressing the errors?

I think you’ll need someone to look at your code at this point.  Remote, time-lapsed, eyes-off debugging can only do so much. 

Sorry.

I struggled with this phenomenon (runtime errors in libraries not being reported in simulator in many of my apps, just silently dying).  After commenting out code one line at a time, I found that it was caused by me using a global variable called “_G.debug”

I renamed my variable to _G.mydebug, and runtime errors are once again reported in the simulator

I don’t claim to know why this fixed the problem, but it definitely did.

That is a great find @scott0!!!  I tested it and indeed, having a global _G.debug kills the messages.  I’ll ask the engineers about this.

Thank you for sharing your find Scott0!  I was having the same problem.  

Changed the global _G.debug to _G.myDebug, and I’m back in business!  

That problem was really slowing the debugging for that one app!