Runtime error when running through 'Recent Projects'

I get a strange error on opening any app from the ‘Recent Projects’ panel. The error is always the same and it doesn’t matter which app it is. There is no error when dropping the main.lua file onto the executable or indeed when the app hot reloads. This is the Mac version with build Corona 2018.3210. The error is:

ERROR: Runtime error

                    ?:0: attempt to call method ‘setFillColor’ (a nil value)

                    stack traceback:

                    ?: in function ‘?’

                    ?: in function ‘?’

                    ?: in function <?:190>

The error appears a moment after the app finishes loading and if I then reload the app the error will not repeat. it doesn’t really affect anything at all but is strange nonetheless and thought it was worth noting.

The display object is invalid.  Check your code.  This is not a Corona issue.
 
 
If your object is (for example) in named bob and you have this:

bob:setFillColor( ... )

 change it to this:

print("is bob valid?", bob ) bob:setFillColor( ... )

likely you’ll see:

is bob valid? nil ERROR: Runtime error ?:0: attempt to call method 'setFillColor' (a nil value) stack traceback: ?: in function '?' ?: in function '?' ?: in function \<?:190\>

I don’t think you read my message clearly otherwise you wouldn’t have said this. It seems like all you looked at was the error message itself rather than the things I wrote.

:slight_smile:

Your original post said, you run an by selecting an app from ‘recent projects panel’ and get an error, then you reload and don’t get the error.

I still think this is your code.  I think that if you check, you’ll find the display object is not being created.

Alternately, are you running on networked drives?  There may be an issue there.

Sure, I could be wrong and maybe there is a Corona simulator hiccup, but I use this feature all day every day without fail which makes me think it is OK.

PS - I should have also mentioned, if you’ve been running the same instance of Corona for a long time and re-loading over and over with lots of errors, etc.  You may want to kill it and start over clean.  I think this kind of usage can cause long-term weirdness.  I’ve seen odd behavior in this case on rare occasion and a clean start fixes it.

I wonder if it would be worthwhile clearing the recents list?

FWIW, this is the first report of this issue I’ve seen. This leads me to think its something local to your computer. We know Apple can get the recents list confused, but it generally crashes the app.  So maybe @roaminggamer’s suggestion to check on network drives or something local to your projects.

I can’t reproduce the problem on my Mac.

Rob

Surely that would be way more weird if it was an error in the code and that the error only occurred when opening the project in ‘recent files’ and  not  when hot reloading it or dropping the main.lua file onto it…

An error that only happens once and never happens again with the exact same code! That would be so weird. It would be hard to create such an error in code and have it happen across all other apps too.

I said in my original post, it happens with _ any _ app so i don’t think every app could have the same error with every project. I even checked a project with no ‘setFillColor’ code command anywhere in the project and it still threw the exact same error.

I don’t have networked drives and I only started using corona a couple of weeks ago. Even projects loaded from different locations on my hard drive throw the same error. I just tried the Horse Animation in the Corona sample code and that throws the same error too.

Not sure what it is and it doesn’t really affect much but I just thought I’d mention it anyway.

I tried clearing the recent list but unfortunately it didn’t solve it. It’s really strange since like I say I’ve only been using Corona for a couple of weeks and haven’t really used it that extensively. A reinstall didn’t help either since I just installed the latest build today to make sure it wasn’t a problem with that particular version.

Would you mind sharing the problem project?  You can PM me a link to a zip and I’ll give it a quick look.

Hey thanks for the additional details and the debug w/ a project that comes with Corona.

I hope this clears up for you.  Unfortunately, I’m a Windows user so I won’t be able to help look into this further.  However if I see anything I’ll post back and add details to this thread.

Question.  If you start Corona fresh and do an immediate re-load does it encounter the issue?  Or, is only if you click a ‘last project’ link from the dialog.

No need to answer if you’re too busy.  I’m just curious.

The horse animation sample code bundled with Corona.

That was also in my original post “The error appears a moment after the app finishes loading and if I then reload the app the error will not repeat.” You actually repeated this in your own post or are you referring to something different? Anyway it’s only when clicking on the app in ‘Recent Projects’.

Whatever happened with this? Such a weird problem.

You can try and clear the simulator’s defaults (preferences and settings) with this:

defaults delete com.coronalabs.Corona\_Simulator

from the terminal. This will blow away everything saved including keystore passwords and every stored setting from the build dialog windows, but if you’ve not been using Corona long, you probably don’t have a lot of history, but a good cleaning of the defaults periodically isn’t a bad thing.

Rob

Ok thanks, I’ll try that.

The display object is invalid.  Check your code.  This is not a Corona issue.
 
 
If your object is (for example) in named bob and you have this:

bob:setFillColor( ... )

 change it to this:

print("is bob valid?", bob ) bob:setFillColor( ... )

likely you’ll see:

is bob valid? nil ERROR: Runtime error ?:0: attempt to call method 'setFillColor' (a nil value) stack traceback: ?: in function '?' ?: in function '?' ?: in function \<?:190\>

I don’t think you read my message clearly otherwise you wouldn’t have said this. It seems like all you looked at was the error message itself rather than the things I wrote.

:slight_smile:

Your original post said, you run an by selecting an app from ‘recent projects panel’ and get an error, then you reload and don’t get the error.

I still think this is your code.  I think that if you check, you’ll find the display object is not being created.

Alternately, are you running on networked drives?  There may be an issue there.

Sure, I could be wrong and maybe there is a Corona simulator hiccup, but I use this feature all day every day without fail which makes me think it is OK.

PS - I should have also mentioned, if you’ve been running the same instance of Corona for a long time and re-loading over and over with lots of errors, etc.  You may want to kill it and start over clean.  I think this kind of usage can cause long-term weirdness.  I’ve seen odd behavior in this case on rare occasion and a clean start fixes it.

I wonder if it would be worthwhile clearing the recents list?

FWIW, this is the first report of this issue I’ve seen. This leads me to think its something local to your computer. We know Apple can get the recents list confused, but it generally crashes the app.  So maybe @roaminggamer’s suggestion to check on network drives or something local to your projects.

I can’t reproduce the problem on my Mac.

Rob

Surely that would be way more weird if it was an error in the code and that the error only occurred when opening the project in ‘recent files’ and  not  when hot reloading it or dropping the main.lua file onto it…

An error that only happens once and never happens again with the exact same code! That would be so weird. It would be hard to create such an error in code and have it happen across all other apps too.

I said in my original post, it happens with _ any _ app so i don’t think every app could have the same error with every project. I even checked a project with no ‘setFillColor’ code command anywhere in the project and it still threw the exact same error.

I don’t have networked drives and I only started using corona a couple of weeks ago. Even projects loaded from different locations on my hard drive throw the same error. I just tried the Horse Animation in the Corona sample code and that throws the same error too.

Not sure what it is and it doesn’t really affect much but I just thought I’d mention it anyway.

I tried clearing the recent list but unfortunately it didn’t solve it. It’s really strange since like I say I’ve only been using Corona for a couple of weeks and haven’t really used it that extensively. A reinstall didn’t help either since I just installed the latest build today to make sure it wasn’t a problem with that particular version.