App works fine in simulator, only black screen on device.

Well, without the basic-ification of the app, there was a black screen then the app exited with the message:

“The application <name> has stopped unexpectedly. Please try again.”

With nothing in config.lua and build.settings and only the code above in main.lua, I still get the same message, the screen doesn’t even get dark, the message hits me immediately.

/BK

not sure if this helps at all but:

https://www.dropbox.com/s/5894svpcigxz8fk/Video%202013-11-27%2017%2010%2057.mov

Why:

./adb shell am start -n xxx.xxx.xxx/com.ansca.corona.CoronaActivity

??

Just type

adb logcat Corona:v \*:s

and that’s all

  1. adb is not used on mac you need to type ./adb

2) ./adb shell am start -n xxx.xxx.xxx/com.ansca.corona.CoronaActivity

where xxx.xxx.xxx is my app launches the app on device 

3) adb logcat Corona:v *:s  (you really need to use ./adb …. though)

what it does is, plots the following on terminal and NOTHING ELSE:

--------- beginning of /dev/log/system

--------- beginning of /dev/log/main

 

UPDATE:

I’ve tested another app and same issue on Android device (works fine in simulator) maybe it’s structure thing?

I have my main.lua in resourcedir, then a dir called scenes, in there I have loader.lua and also in the resourcedir I have “general” folder where I keep my general modules like database/file/other handlers.

 

Again works fine on simulator.

 

/BK

I read somewhere that corona apps do not run on ARMv6 processors and the phone I am testing on with ./adb install and logcat is http://en.wikipedia.org/wiki/LG_Optimus_One

it has Android version 2.3.3

the pad I am testing on is DMTECH Tablet 726H (Android v: Jelly Bean 4.1) with processor: Cortex-A9 CPU (1.0GHz)

Two other android devices get the same result (black screen only).

Something is not right.

I’ll test some basic apps (provided with the sdk) to see if any of those will run on my hardware.

/BK

Widget Demo worked on the tablet, failed on the phone, so I guess the phone is not good enough testing hardware even if android version is above 2.2.

playing with config and build.settings files now.

/BK

I believe the Optimise One is based on Armv6. Would be the most likely cause.

I am thinking one reason could be network.canDetectNetworkStatusChanges but I removed and tried without, same error.

The adb log makes no sense to me, something is failing to load but what?

I have checked the filenames so I know about the case-sensitive filename issue, it’s not it.

I doubt you’ll have much luck with Optimus One. Out of curiosity, have you tried a different image besides bg.png? I have ran into 2 “black screens of death” since 2.0 graphics. One was resolved by changing the image to a .jpg, might try that. Best.

remarking

Runtime:addEventListener( “location”, locationHandler ); – the gps eventhandler

prevented the app from cruhing, even if it had error handling.

This is awesome news.

I could ignore the gps or make a workaround.

Now I need to check how to read gps on android, if any different than normally.

/BK

I’m having the same issue on my app running on iPhone / iPad after moving my app to G2. Looking for a discussion on your findings pointing to the jpg change etc. Is there a thread on this? Thanks

@ksan I don’t have any threads going and still have not submitted my test case.  It’s been hard to manage projects and get bug reports in right now.  A lot of moving targets in G2, as I’m sure you’re aware.

I was in a rush to get my project out, so after having no luck trying other options, I tried the background image as a .jpg on a whim, and it worked!  I moved on and have not had a chance to revisit, and more importantly have not had the issue since.

The strange thing is that all other items in the scene were “invisible” when the background was not loading.  I could still tap on buttons, etc.  After the .jpg change, all other items showed up as well.

Did you try changing any background or large image to .jpg?  Are you having the same results on Android?

I just saw your other thread…I assume this is no longer as issue.

Cheers.

Thanks for the added info. Its most weird indeed. As you noticed my issue was nothing related it turned out. All is good on this end. Sorry for the thread hijacking. 

Do you have the logs from the device?

No, I do not have a device, will get this today. A friend has been kind to test the app on his device. We get just a dark screen , nothing happens.

Next step is to get a hardware and test on it and perhaps see what logs are being generated.

/BK

Oh, by the way I am aware of the problem with stating questions like  “My app works fine in the Simulator, but doesn’t work on the device. What’s wrong?"

My problem with all this is WHY does this work on the simulator?

I mean something has to be done. If I can’t trust my simulator, what is the point?

If my testing really begins when the app hits the hardware, what is the point with the simulator?!

I am reading this at the moment:

http://www.coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

/BK

Why, becuse windows is not case-sensitive when it comes to file names and mobile devices based on ios and android are.

As name suggests it is ‘simulator’ and it only simulates device. You always have to do test on real thing - everybody does from programmer to engineers and scientists :slight_smile:

@piotrz55, I appreciate your input and all your input is correct, I agree with that.

I am not new to system development, and I am aware of what it means. My issue with it (and I know it doesn’t do anything to solve the issue really) is why it works on simulator and fails on device. It’s like it would work on your compiler and when installed on system it won’t start, simulator being the system you are testing/building your program (in traditional development). That actually happens a lot when targeted device(read system) has not all the files required by your program (think windows and client/server for example).

I am aware this complaining won’t help me find the issue really but it’s a lot about trust really and now I am being failed by the simulator. I am being led into believing my app works fine on an Android device but in reality it does not. 

Surely I am not the only person having issue with this? If I am, then I apologize and carry on as you were.

/BK

To be fair, we don’t even know what the problem is on the device that is keeping it from running correctly. If you could locate and provide the log files from the device, we’d be able to take a look and be better equipped to inform you as to why it’s working on the simulator and not the device. Some possible problems:

  1. Case-sensitive asset files

  2. Unsupported config sizes

  3. Lack of identification of dependencies

There are vagaries inherent in deploying to Android devices that cannot/should not be replicated in a simulator. If you could get the logs we can definitely take a look at those, and it would help us identify the exact issue you are encountering.

I am interested on the name of the device it is is not working on because I am having an issue similar to this.  I have seen it on the Razr Maxx and Galaxy Tab both of which have the same type of gpu.