URGENT: Fatal Lua Error in Solar2D Builds

I cannot run my apps in Simulator as of mid-day today, Sept 2, 2024, with Builds 3708 & 3709.

No amount of restarts or updates fixed this.

As you can see below, this issue appears to be specific to my Mac M1 Pro; running latest OS. I’ve already reinstalled Solar Build 3709. No fix.

It works properly about 1% of the time. And at present, I am completely unable to update my apps. I must have my co-developer do it.

This shows in my Simulator console window:

Program starting as ‘"/Applications/Corona-3709/Corona Simulator.app/Contents/MacOS/Corona Simulator" -no-console YES “/Volumes/2020/Dropbox/Projects/AMEN/main.lua”’.
Program ‘Corona Simulator’ started in ‘/Volumes/2020/Dropbox/Projects/AMEN’ (pid: 5268).
2024-09-02 17:20:43.801 Corona Simulator[5268:112208] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.

Copyright (C) 2009-2024 C o r o n a L a b s I n c .
Version: 3.0.0
Build: 2024.3709

Copyright (C) 2009-2024 C o r o n a L a b s I n c .
Version: 3.0.0
Build: 2024.3709
Loading project from: /Volumes/2020/Dropbox/Projects/AMEN
Project sandbox folder: ~/Library/Application Support/Corona Simulator/AMEN-9D07373DB0A2CE683A7D244195D12044
PANIC: fatal Lua error: attempt to index a nil value
Program completed in 1.16 seconds (pid: 5268).

I know you’ve been having problems with builds not working, but if I read your post correctly, Solar2D no longer runs at all on your machine.

Critical question: Did this particular problem start when you updated to the latest version of MacOS, or was it occurring before you updated?

It was occurring before the update. I was hopeful installing the OS update would solve the problem, but it did not.

I’m running Sonoma 14.6.1 on my MacBook M1 Pro (runs like a dream). Are you running new Apple Silicon?

I’ve got an M1 MacBook Air running 14.2.1, and I just did a successful Android build with Solar2D 3709.

Am I correct in my reading of your post that Solar2D will no longer run at all on your machine?

Apparently, the issue comes up about 99% of the time. I’m not sure what the problem is, but once in a while, it works. I found this out running Sample Code. I chose the horseAnimation; quick and simple. But the point is, Solar2D is now running some Lua code BEFORE it runs any of the Sample Code. Strange huh? But definitely makes Solar2D BROKEN until someone fixes it, or tells me what I must change on my computer to make it work.

To be clear, the issue is that I can’t even see the simulator come up. And therefore, I can’t make any build whatsoever. Here’s what I get trying to run the Sample Code/Animation/Sprite Tiles project.

Program starting as ‘"/Applications/Corona-3709/Corona Simulator.app/Contents/MacOS/Corona Simulator" -no-console YES “/Applications/Corona-3709/SampleCode/Animation/SpriteTiles/main.lua”’.
Program ‘Corona Simulator’ started in ‘/Applications/Corona-3709/SampleCode/Animation/SpriteTiles’ (pid: 22232).
2024-09-02 22:06:34.013 Corona Simulator[22232:340679] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.

Copyright (C) 2009-2024 C o r o n a L a b s I n c .
Version: 3.0.0
Build: 2024.3709

Copyright (C) 2009-2024 C o r o n a L a b s I n c .
Version: 3.0.0
Build: 2024.3709
Loading project from: /Applications/Corona-3709/SampleCode/Animation/SpriteTiles
Project sandbox folder: ~/Library/Application Support/Corona Simulator/SpriteTiles-4CCB850D2A7876D1423EA062562D1F0C
PANIC: fatal Lua error: attempt to index a nil value
Program completed in 0.70 seconds (pid: 22232).

OK- just to compare notes, here is what I see in the console when I start Solar2D 3709:

Sep 03 11:27:08.089 Copyright (C) 2009-2024 C o r o n a L a b s I n c .
Version: 3.0.0
Build: 2024.3709
Sep 03 11:27:23.199 2024-09-03 11:27:23.198 Corona Simulator[8069:337473] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
Sep 03 11:27:23.200

The “Welcome to Solar2D” window is next to the console, and I haven’t done anything yet.

+1
I also build Android successful with Solar2D 3709 with M1 Mac on 14.6.1

1 Like

Next, I launch the Sprite Tiles project. My console output now looks like this:

Sep 03 11:27:08.089 Copyright (C) 2009-2024 C o r o n a L a b s I n c .
Version: 3.0.0
Build: 2024.3709
Sep 03 11:27:23.199 2024-09-03 11:27:23.198 Corona Simulator[8069:337473] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
Sep 03 11:27:23.200
Sep 03 11:33:51.355 Copyright (C) 2009-2024 C o r o n a L a b s I n c .
Version: 3.0.0
Build: 2024.3709
Sep 03 11:33:51.366 Loading project from: /Applications/Corona-3709/SampleCode/Animation/SpriteTiles
Sep 03 11:33:51.366
Sep 03 11:33:51.369 Project sandbox folder: ~/Library/Application Support/Corona Simulator/SpriteTiles-4CCB850D2A7876D1423EA062562D1F0C
Sep 03 11:33:51.420 Platform: iPad / unknown / 14.2.1 / Apple M1 / 2.1 Metal - 88 / 2024.3709 / en-US | DE | en_US@rg=dezzzz | en

So, we’ve got identical output right up to the point when Solar2D has a panic and crashes.

I think we can at least rule out NSApplicationDelegate.applicationSupportsSecureRestorableState as having anything to do with the problem.

Deleting the data was too risky, so I deleted the post anyway.

But you can try backup “~/Solar2DPlugins” to another folder name, and try a build, it will re-download the plugins, if not work rename it back.

@clang I think your first instinct was correct about tearing out all the support libraries.
I just checked the SpriteTiles code, and it doesn’t have any plugins, so deleting the plugins directory shouldn’t have any effect.

1 Like

Undeniably, something has gone wrong with your installation of Solar2D. However, from the sound of things, it is something that has gone wrong somewhere within your computer. Unfortunately, that means that there isn’t much chance that a fix can come down from on high- it’s going to come down to messy detective work. 🫤

Suggestion:

  1. Since you’re using a Mac, you probably have several versions of Solar2D installed right now. I would uninstall all of them.
  2. Restart your computer. (Why not?)
  3. Install the last version you were able to do a build from. Probably 3706.
  4. Confirm that you can launch apps in the simulator.
  5. Confirm that you can make Android builds.
  6. Install version 3709.
  7. See if the problem is still there.

If the above breaks down at step 4 or 5, then the next step is going to involve manually deleting libraries, per what clang suggested, and if it comes to that, perhaps he will be so good as to re-post the locations of all those libraries. (Delete libraries at your own risk, back things up, caveat emptor, etc.)

1 Like

Hi @colinmorgan Yes, all steps 1-5 work perfectly. When I do 6, I install version 3609. I am now confirming that step 7 fails exactly as the Topic start reports. LUA is failing.

Does anyone have any ideas how I can track down this problem? I’m not running native, so I don’t even know where to begin.

I am stumped. Is there anything unique about your system? Are you running some other program that has installed libraries that Solar2D is also using? clang sounds like he has the same processor and MacOS system version as you, and he’s not running into this issue.
Follow-up question:

  • When you go back to 3606, does it work, or has installing 3609 broken everything?

Lucky guess. Try clear the Project Sandbox.

Yes, 3606 works perfectly, but doesn’t support the new Google Billing; not sure about the new API version.

To clear the sandbox, I need the Simulator to start and show my app running. But not even the first line of LUA code executes.

I am confused, is the “Project sandbox folder” refer to sandbox? Just before the line of “PANIC: fatal Lua error: attempt to index a nil value”.

If it works for 3706 but not 3709, it may related to parsing the build.settings facility, so please share your build.settings, which is the one that works for 3706 and not 3709.

Then, just in case, does your Apple Silicon Mac have Rosetta installed? Try installing Rosetta or via command line.

I use only Windows but chatgpt suggests take a look
/Users/<username>/Library/Application Support/Corona Simulator/<project_name>-<project_id>

1 Like