Runtime Error, module ... not found (solved)

My game is running perfectly on the simulator, but when I install and open it on my phone, i get a Runtime Error:
“module ‘scenes.menu’ not found:resource(scenes.menu.lu) does not exist in archive
no field package.preload[‘scenes.menu’]…”

I divided my code into several scenes with composer and put the scene file in a folder in the project folder.

Here are my build settings:

settings =
{
orientation =
{

	default = "portrait",
	supported = { "portrait" },
},



android =
{
	
	usesPermissions =
	{
		"android.permission.INTERNET",
		"android.permission.WRITE_EXTERNAL_STORAGE",
	},
},

}

Does anyone know why I get this error?

I’m not sure if it will help you, but it something you should check if the problem appears only on phone and not on the simulator and related to your files:
When you run your app on the simulator, it uses your Windows file system - which is not case sensitive (Myname.lua is same as myname.lua and myname.LUA is same as myname.lua). BUT when moving your app to an actual phone which probably runs Android - it case sensitive! meaning that the file Myname.lua is a different file from myname.lua !

If I where you, I would go over all your file names and file extension (.lua is not .LUA) and check if they all match to what you using in your code (require module and not require Module).

Hope it will help!

4 Likes

Thank you so much, that was actually the case. My scene folder was called “Scenes” with a capital letter but in the code i wrote “scenes” in lower case. You saved me many hours of searching for a solution

2 Likes