Runtime Errors that differ from the Simulator

Hello,

Lately I’ve been doing a lot of coding but often I’ve been getting a weird error when I build the app so I can run it for my android phone, the error says 

Runtime Error

C:\Users\Hayden\Documents\Corona Projects\WhyAlwaysMe\main.lua:153:attempt to index global ‘pointer’ (a nil value)

I’m very confused about this error because everything else in app still runs i.e the timer still counts down and animations still play. I don’t ever get this error on my laptop when I’m running the app in the simulator so why would I be getting this now?

I’ve checked in both the lua files in using ( I “require” each file because I have a menu) and the file the error says to look at only has 93 lines of code and the other lua file has some of my commented out code on line 153.

Any and all help would me much appreciated, thank you in advance

Hayden

If we disregard the line number for the moment, I’d start by checking all places in your code where you use the variable named pointer and make sure that it’s properly instantiated before use.

When things work on the simulator but not on a device, the first thing I check is whether I have any filename errors in my code. Some devices / OS are case sensitive and some are not.  

So if you have a file called “myPointer.png” but in your code you’ve typed “mypointer.png” (notice the P is lowercase now), it will work on some systems but not others.

This is not an issue Corona can fix, it’s just how the different OS work.

Thank you both for the help.

It turns out the pointers image file was spelt with a capital but in the code it wasnt. Noob mistake, Once again thank you for your help

If we disregard the line number for the moment, I’d start by checking all places in your code where you use the variable named pointer and make sure that it’s properly instantiated before use.

When things work on the simulator but not on a device, the first thing I check is whether I have any filename errors in my code. Some devices / OS are case sensitive and some are not.  

So if you have a file called “myPointer.png” but in your code you’ve typed “mypointer.png” (notice the P is lowercase now), it will work on some systems but not others.

This is not an issue Corona can fix, it’s just how the different OS work.

Thank you both for the help.

It turns out the pointers image file was spelt with a capital but in the code it wasnt. Noob mistake, Once again thank you for your help