As the subject states I can’t run my project if I load it directly with the Corona Simulator, I have tried publishing it but to no avail.
The error I get is
[lua] Runtime error: module ‘menu’ not found:resource (menu.lu) does not exist in archive
no field package.preload[‘menu’]
no file ‘/Users/iZeal/Documents/Corona Projects/iDwarfs!menu/menu.lua’
no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/menu.lua’
no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/menu.blu’
stack traceback:
[C]: ?
[C]: in function ‘require’
?: in function ‘gotoScene’
…s/iZeal/Documents/Corona Projects/iDwarfs!?/main.lua:17: in main chunk [/lua]
the menu.lua file is in the same directory as everything else. Anyone got an idea on how to solve this? [import]uid: 129450 topic_id: 22615 reply_id: 322615[/import]
I concur with Jay it appears as the error states on line 17 in your main.lua file it should be as Jay said. I like the Director Class my self and use a template for everything so I use the following:
local director = require(“director”)
local mainGroup = display.newGroup()
local function main()
mainGroup:insert(director.directorView)
director:changeScene(“loadmenu”)
return true
end
main()
This uses the directore class to call your menu.lua file.
One thing to check is the case of the file names being loaded. If you are doing a require “menu” but the file is actually “Menu”, it will work in the simulator (CPM) but give you an error on the device since the device is case-sensitive. [import]uid: 7559 topic_id: 22615 reply_id: 90235[/import]
– Hide status bar
display.setStatusBar ( display.HiddenStatusBar )
– load first screen
storyboard.gotoScene( “menu” )
Wierd thing is that I’am able to run it when I start it with CPM and everything works fine, it also works if I make an android build and try it on my phone. It is only when I try to run it directly through Corona Simulator I get the error. [import]uid: 129450 topic_id: 22615 reply_id: 90448[/import]
Yes that’s the name of the folder. However thanks to you I tried to publish the project to a folder without the !? (which I thought I had already tried btw) and it works!
Still find it strange that CPM don’t pick this up.
Thanks for the help everyone! [import]uid: 129450 topic_id: 22615 reply_id: 90452[/import]
CPM is using the Corona Simulator to simulate the app. I assume when you say “Corona Simulator” you mean the iOS Simualtor on the Mac.
Generally, when things work on the Corona Simulator and not on a certain device, it comes down to characters used in the file name or case sensitivity. It’s very hard to detect and flag those types of problems in the Corona Simulator. The iOS Simulator generally mimics the functionality of the iOS devices.
With that said, it’s best to limit your file name characters to alpha-numeric, underscore ("_") and dash ("-"). [import]uid: 7559 topic_id: 22615 reply_id: 90571[/import]