Director Class Error (Soleved)

Im using director class to manage my scenes.
When i run my game in Simulator , then there is no erros nor any problems

But when i run it on the device, then error message comes up saying "Director error: Failed to execute new (params) function on ‘levelselect’ "
And just displaying black screen ofter that,
Any ideas?
Thanks [import]uid: 11559 topic_id: 21666 reply_id: 321666[/import]

@ Ayena

If you could post some code Id be happy to help ya out. But without seeing some of your code is hard to determine the problem sorry. [import]uid: 30314 topic_id: 21666 reply_id: 85944[/import]

Hey thanks for the help
Like i said no errors on output, it doe that only on the device itself.

Here is the code

[code]

– Level select page

module(…,package.seeall)


– local objects declaration

local backgroung
local number1
local number2
local number3
local number4
local number5
local number6
local number7
local number8
local number9
local number10
local number11
local number12
local number13
local number14
local number15
local number16


–Button press handlers goes here

– when yes pressed then opens appstore to download pro version
local function yesHandler(ev)
if ev.index ~= 1 then return end
system.openURL( “http://itunes.com/apps/AyenaLLC” )
end
– When store pressed
local function storePressed(b)
game.playEventSound(game.soundPressed)
native.showAlert(“Upgrade”,“Would you like to upgrade to get more levels?”,{“Yes, Please.”,“No, Thanks.”}, yesHandler)
end

– Main menu button
local function mainMenuPressed(b)
game.playEventSound(game.soundPressed)
game.changeScene(“mainscene”, “fade”)
end

– Number 1 pressed
local function number1Pressed(b)
game.playEventSound(game.soundPressed)
game.changeScene(“level1”, “fade”)
end

– Number 2 pressed
local function number2Pressed(b)
if game.levels >= 2 then
game.playEventSound(game.soundPressed)
game.changeScene(“level2”, “fade”)
end
end

– Number 3 pressed
local function number3Pressed(b)
if game.levels >= 3 then
game.playEventSound(game.soundPressed)
game.changeScene(“level3”, “fade”)
end
end
– Number 4 pressed
local function number4Pressed(b)
if game.levels >= 4 then
game.playEventSound(game.soundPressed)
game.changeScene(“level4”, “fade”)
end
end
– Number 5 pressed
local function number5Pressed(b)
if game.levels >= 5 then
game.playEventSound(game.soundPressed)
game.changeScene(“level5”, “fade”)
end
end

– Number 6 pressed
local function number6Pressed(b)
if game.levels >= 6 then
game.playEventSound(game.soundPressed)
game.changeScene(“level6”, “fade”)
end
end

– Number 7 pressed
local function number7Pressed(b)
if game.levels >= 7 then
game.playEventSound(game.soundPressed)
game.changeScene(“level7”, “fade”)
end
end
– Number 8 pressed
local function number8Pressed(b)
if game.levels >= 8 then
game.playEventSound(game.soundPressed)
game.changeScene(“level8”, “fade”)
end
end

– Number 9 pressed
local function number9Pressed(b)
if game.levels >= 9 then
game.playEventSound(game.soundPressed)
game.changeScene(“level9”, “fade”)
end
end

– Number 10 pressed
local function number10Pressed(b)
if game.levels >= 10 then
game.playEventSound(game.soundPressed)
game.changeScene(“level10”, “fade”)
end
end

– Number 11 pressed
local function number11Pressed(b)
if game.levels >= 11 then
game.playEventSound(game.soundPressed)
game.changeScene(“level11”, “fade”)
end
end
– Number 12 pressed
local function number12Pressed(b)
if game.levels >= 12 then
game.playEventSound(game.soundPressed)
game.changeScene(“level12”, “fade”)
end
end

–[[ Number 13 pressed
local function number13Pressed(b)
if game.levels >= 13 then
game.playEventSound(game.soundPressed)
game.changeScene(“level13”, “fade”)
end
end

– Number 14 pressed
local function number14Pressed(b)
if game.levels >= 14 then
game.playEventSound(game.soundPressed)
game.changeScene(“level14”, “fade”)
end
end

– Number 15 pressed
local function number15Pressed(b)
if game.levels >= 15 then
game.playEventSound(game.soundPressed)
game.changeScene(“level15”, “fade”)
end
end

– Number 16 pressed
local function number16Pressed(b)
if game.levels >= 16 then
game.playEventSound(game.soundPressed)
game.changeScene(“level16”, “fade”)
end
end

]]


– All the scene objects must go here

function new()
group = display.newGroup()

– Add Background
background = display.newImageRect( “levelselect/levelselectbkg.png”, 480, 320 )
background.x = 240
background.y = 160
group:insert(background)


– Add all the buttons here

– Main Menu button

button:create(group,1,{x=43,y=302,w=86,h=33,handler=mainMenuPressed},“levelselect/menu.png”)
button:create(group,1,{x=432,y=302,w=86,h=33,handler=storePressed},“levelselect/store.png”)

number1=button:create(group,1,{x=37,y=127,w=48,h=48,handler=number1Pressed},“levelselect/lock.png”)
if game.levels >= 1 then number1.image=“numbers/1.png” end

number2=button:create(group,1,{x=92,y=127,w=48,h=48,handler=number2Pressed},“levelselect/lock.png”)
if game.levels >= 2 then number2.image=“numbers/2.png” end

number3=button:create(group,1,{x=147,y=127,w=48,h=48,handler=number3Pressed},“levelselect/lock.png”)
if game.levels >= 3 then number3.image=(“numbers/3.png”) end

number4=button:create(group,1,{x=332,y=127,w=48,h=48,handler=number4Pressed},“levelselect/lock.png”)
if game.levels >= 4 then number4.image=(“numbers/4.png”) end

number5=button:create(group,1,{x=387,y=127,w=48,h=48,handler=number5Pressed},“levelselect/lock.png”)
if game.levels >= 5 then number5.image=(“numbers/5.png”) end

number6=button:create(group,1,{x=442,y=127,w=48,h=48,handler=number6Pressed},“levelselect/lock.png”)
if game.levels >= 6 then number6.image=(“numbers/6.png”) end

number7=button:create(group,1,{x=47,y=197,w=48,h=48,handler=number7Pressed},“levelselect/lock.png”)
if game.levels >= 7 then number7.image=“numbers/7.png” end

number8=button:create(group,1,{x=102,y=197,w=48,h=48,handler=number8Pressed},“levelselect/lock.png”)
if game.levels >= 8 then number8.image=(“numbers/8.png”) end

number9=button:create(group,1,{x=157,y=197,w=48,h=48,handler=number9Pressed},“levelselect/lock.png”)
if game.levels >= 9 then number9.image=(“numbers/9.png”) end

number10=button:create(group,1,{x=322,y=197,w=48,h=48,handler=number10Pressed},“levelselect/lock.png”)
if game.levels >= 10 then number10.image=(“numbers/10.png”) end

number11=button:create(group,1,{x=377,y=197,w=48,h=48,handler=number11Pressed},“levelselect/lock.png”)
if game.levels >= 11 then number11.image=(“numbers/11.png”) end

number12=button:create(group,1,{x=432,y=197,w=48,h=48,handler=number12Pressed},“levelselect/lock.png”)
if game.levels >= 12 then number12.image=(“numbers/12.png”) end

return group
end
[/code] [import]uid: 11559 topic_id: 21666 reply_id: 85947[/import]

I have the same issue in my app. Was talking to ansca this morning and they said to check the case of code. The Simulator is not case sensitive but the devices are. [import]uid: 10389 topic_id: 21666 reply_id: 85948[/import]

is backgroung and background supposed to be the same? [import]uid: 10389 topic_id: 21666 reply_id: 85949[/import]

@ Waulok

Yes that was miss spell. But thats not the case of my problem. Would you tell me more about your problem, is it been fixed?

Thanks [import]uid: 11559 topic_id: 21666 reply_id: 85954[/import]

I will have to look at my code tonight. I’m not able to test at the moment but I see a few people with the error. I think it’s a generic error as it doesn’t tell much. [import]uid: 10389 topic_id: 21666 reply_id: 85956[/import]

Does this error occur no matter which button you press?
Or does it occur when you switch to this page? [import]uid: 10389 topic_id: 21666 reply_id: 85958[/import]

It occurs when I press play button from main scene but I checked play button function everything is fine there. In fact it gives error for the levelselect.lua I have already spend 3 days trying to figure out. But no lack [import]uid: 11559 topic_id: 21666 reply_id: 85965[/import]

I don’t know if your game.playEventSound confuses Corona with the media.playEventSound
Could you rename it just to try?
Just fishing here…
You could try adding PRINT statements before each function so you can read the device’s console output to see if it stops at one spot. [import]uid: 10389 topic_id: 21666 reply_id: 85968[/import]

Are your sounds CAF or AIF? [import]uid: 10389 topic_id: 21666 reply_id: 85969[/import]

caf, but i dont think thats the problem. I have done other app the same way and no problem. I think problem is in the levelselect.lua itself somewhere there [import]uid: 11559 topic_id: 21666 reply_id: 85970[/import]

I have put print statement on very line and everything is being called normally. I have no idea what is going on here. [import]uid: 11559 topic_id: 21666 reply_id: 85974[/import]

This happened after i updated director class [import]uid: 11559 topic_id: 21666 reply_id: 85975[/import]

Have you happened to find a fix for it yet Ayena?

I’m also having this same issue. The game runs fine in the simulator under all devices.

But this same error gets pulled as soon as I go to play the game on my device an HTC Evo 4G.

My issue though is that I’m such a noob at programming that I have no idea if it’s my mistake or an issue with Director or Corona. But since it’s working fine on the simulator I figured it should work fine on the device? No? [import]uid: 123298 topic_id: 21666 reply_id: 86225[/import]

No I haven’t yet. In my case that is director issue because I look everywhere .
You can post some code here, I can take a look. [import]uid: 11559 topic_id: 21666 reply_id: 86234[/import]

Thanks for the offer Ayena.

But I’m a total dummy, in my process of cleaning up my code a bit to post here I figured it out.

[lua]local sky = display.newImage(“NightSky.png”)[/lua]

on my asset folder it was nightSky.png…not capitalized.

One letter, I spent all day trying to figure out what it was…one freaking letter lol

Sorry I can’t be much of a help, but that’s what ended up fixing my issue.

Now I’m curious as to how much the simulators reflect actual phones. I ended up using the Android AVD emulators and they behaved just like my phone. It would freeze up at the same spot, but while on the Corona SDK simulator it ran perfectly. [import]uid: 123298 topic_id: 21666 reply_id: 86281[/import]

Glad you fixed it. As i know iphone is case sensitive and simulator is not. [import]uid: 11559 topic_id: 21666 reply_id: 86346[/import]

Simple rule, never mix lower and uppercase in filenames = no problems :slight_smile:
[import]uid: 81188 topic_id: 21666 reply_id: 86349[/import]

Double post…
[import]uid: 81188 topic_id: 21666 reply_id: 86350[/import]