Crashes on entering game from menu with HTC Desire HD, works perfect in Android Simulator

Hi, this is really confusing for me. The app works perfectly in the simulator but just gives a blank screen and crashes with NO error messages on my HTC Desire HD when pressing the start game button.

Here is the main.lua file that just loads up the menu.lua file.

This works!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
_H = display.contentHeight;
_W = display.contentWidth;
 
local director = require("director");
 
local mainGroup = display.newGroup();
 
local function main()
 
        mainGroup:insert(director.directorView);
        
        director:changeScene("menu");
        
        return true;
end
 
main();

I have now simplified the code and If I use a local text object in the scene screen1.lua it works and looks like this. BUT it doesn't work when I use a local image instead like the last code in this post.

main.lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- import the director class
local director = require("director")
 
-- Create a main group
local mainGroup = display.newGroup()
 
-- Main function
local function main()
 
        -- Add the group from the director class 
        mainGroup:insert(director.directorView)
        
        -- Change scene without effects
        director:changeScene("intro")
        
        return true
end
 
-- Begin
main()

I do not have an android device, but I think it may not work because you have your images in a sub directory "images/hero.png".

I think I read that causes a problem on actual devices using android?

I would try putting the images in the main directory with your code and changing the code to just "hero.png" etc

THANK YOU! Now it works just fine.
It's kind of wierd that I could use subfolders when not using the Director class and just one screen, but I'll just skip the subfolders for the android version now.

views:1532 update:2011/10/13 9:25:17
corona forums © 2003-2011