Game not opening on Android

Working on a game and I'm trying to run a test build on my HTC Evo 4G and when I run it merely goes to a black screen and then back to the home screen. Of course it runs fine in the simulator and I've even had it run successfully on an iPod.
I thought it could be in the build.settings but I have those set up exactly as I had a previous game that worked.

Any ideas what could be causing this issue or how to debug it?

Do you have your assets in the root directory of your project or in subfolders?

-Nick Homme

Thanks for the reply. I have all the files in one project folder, no subfolders. Any other ideas?

Hi there,

I have exactly the same issue!

My app runs perfectly in the simulator, and also when built & installed on my iPhone - but it will not run on my Android HTC.

I am using the director class as a base, and accessing the GPS data.

Could it be director class that is causing me the problems?

@ ratdoggames: did you fix this?

thanks

@robinhblane :- director class is not supposed to create problem

@ratdoggames and @robinhblane :-

make sure all files are calling with correct name means:-

bg.png should not call as Bg.png

also make sure all apis you are using are supported for android (most will be supported but still chk it to make sure)

:)

Hello hgvyas123

Thanks for your quick reply.

I have tested director, and yes it works perfectly - so the problem is in my code somewhere.

I am busy commenting out everything in my main.lua & my screen1.lua to try to get the app to load, I assume that only those two files are accessed in the initial starting of the app?

more anon......

Progress so far.....

My app is based on the director class example, and in the main.lua, within the

 local main = function()

I have been declaring a table to hold some global variables...

1
2
3
 myGlobals = {}
myGlobals.helpID = 10
...

actually global variable doesn't need declaration it's simple

as k = 1 so there are no chance to that you had declare them incorrectly also with this declaration you can run on ios so that's not problem you had declare those globals correctly

without seeing the code i can say only these things also its a strange that it is working for ios device but not in android

can't you see anything in android?? if yes maybe the problem is in the very starting i can't say anything why that had worked in android after removing and commenting some code

Ok, I am learning here....

I am now over 90% of the way to having my app running properly on Android ( or as well as it does on iPhone!)

After a lot of remming out of code I discovered that in order to call
system.getInfo() or access "location" data, on an Android, I needed to have a build.settings file.

I now have one:

1
2
3
4
5
6
7
8
9
settings =
{
   androidPermissions =
   {
       "android.permission.READ_PHONE_STATE",
       "android.permission.ACCESS_FINE_LOCATION"
   },
 
}
views:1487 update:2011/10/8 8:54:25
corona forums © 2003-2011