Director Class Error

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

@ 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.

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

Here is the code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
-----------------------------------------------------------------------------------
-- 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

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.

is backgroung and background supposed to be the same?

@ 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

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.

Does this error occur no matter which button you press?
Or does it occur when you switch to this page?

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

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.

Are your sounds CAF or AIF?

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

I have put print statement on very line and everything is being called normally. I have no idea what is going on here.

This happened after i updated director class

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?

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.

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.

local sky = display.newImage("NightSky.png")

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.

views:2791 update:2012/2/13 9:11:28
corona forums © 2003-2011