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

I have no idea why, I am using internet, upload/download images from camera/lib.

Geolocation (gps) and read/write to/from Documents dir.

What’s wrong?

/BK

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.

@PaNc, Thank you for caring.

Since I have no idea how this is done I’ve spent all day playing around and reading documentation on how to get adb running and reading some kind of feedback from the android device, no success just yet, if I could do that I am sure I would be able to get what it means, if it makes sense. The documentation I read on debugging (android) is very poor, leaves you guessing and is not working if you follow it exactly, so no luck there just yet. Maybe all we need is a real good android debugging doc.

@alexk413x, I am sure it’s not working on more than just my andoid device, as far as I know at least 3 different hardware test has been done, no luck on any of those.

Thanks, I appreciate the feedback.

/BK

well, after some research I was able to connect a device and read some logging from the device when app is being launched


/ActivityManager( 1593): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=se.safepartner.safepartner/com.ansca.corona.CoronaActivity bnds=[163,338][237,417] } from pid 1713

I/ActivityManager( 1593): Start proc se.safepartner.safepartner for activity se.safepartner.safepartner/com.ansca.corona.CoronaActivity: pid=6338 uid=10044 gids={3003, 1015}

I/ActivityThread( 6338): <!>android.app.ActivityThread 3312<!> Pub se.safepartner.safepartner.files: com.ansca.corona.FileContentProvider

W/dalvikvm( 6338): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/ansca/corona/JavaToNativeShim;

W/dalvikvm( 6338): Exception Ljava/lang/ExceptionInInitializerError; thrown while initializing Lcom/ansca/corona/CoronaEnvironment;

W/dalvikvm( 6338): threadid=1: thread exiting with uncaught exception (group=0x40018560)

E/AndroidRuntime( 6338): FATAL EXCEPTION: main

E/AndroidRuntime( 6338): java.lang.ExceptionInInitializerError

E/AndroidRuntime( 6338):     at com.ansca.corona.CoronaActivity.onCreate(CoronaActivity.java:116)

E/AndroidRuntime( 6338):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)

E/AndroidRuntime( 6338):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)

E/AndroidRuntime( 6338):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)

E/AndroidRuntime( 6338):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)

E/AndroidRuntime( 6338):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)

E/AndroidRuntime( 6338):     at android.os.Handler.dispatchMessage(Handler.java:99)

E/AndroidRuntime( 6338):     at android.os.Looper.loop(Looper.java:123)

E/AndroidRuntime( 6338):     at android.app.ActivityThread.main(ActivityThread.java:3729)

E/AndroidRuntime( 6338):     at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime( 6338):     at java.lang.reflect.Method.invoke(Method.java:507)

E/AndroidRuntime( 6338):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:874)

E/AndroidRuntime( 6338):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:632)

E/AndroidRuntime( 6338):     at dalvik.system.NativeStart.main(Native Method)

E/AndroidRuntime( 6338): Caused by: java.lang.ExceptionInInitializerError

E/AndroidRuntime( 6338):     at com.ansca.corona.CoronaEnvironment.setLuaErrorHandler(CoronaEnvironment.java:373)

E/AndroidRuntime( 6338):     at com.ansca.corona.CoronaEnvironment.<clinit>(CoronaEnvironment.java:41)

E/AndroidRuntime( 6338):     … 14 more

E/AndroidRuntime( 6338): Caused by: java.lang.UnsatisfiedLinkError: Couldn’t load lua: findLibrary returned null

E/AndroidRuntime( 6338):     at java.lang.Runtime.loadLibrary(Runtime.java:429)

E/AndroidRuntime( 6338):     at java.lang.System.loadLibrary(System.java:554)

E/AndroidRuntime( 6338):     at com.ansca.corona.JavaToNativeShim.<clinit>(JavaToNativeShim.java:104)

E/AndroidRuntime( 6338):     … 16 more

W/ActivityManager( 1593):   Force finishing activity se.safepartner.safepartner/com.ansca.corona.CoronaActivity


so what do I do with this?

This tells me absolutely nothing what the problem is, does it?

/BK

You must filter logs from Corona, otherwhise you’ll be flooded with all Android actions.

Use 

adb logcat Corona:v \*:s

filtering gives me nothing but:

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

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

starting the app doesn’t produce any logs.

I’ve run first:

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

then the filter you suggested.

/BK

I’ve tried building with a newer version, used 2013.1240 (2013.10.22) after compatibility changes (gfx.2) the app works on simulator and fails on android device (still).

running ./adb shell am start -n xxx.xxx.xxx/com.ansca.corona.CoronaActivity triggers my app on device to be launched and immediately it crashes.

No clue what’s going on.

The app uses reverse geolocation, talking to server, downloading data, uploading images, widgets such as datepicker, button, tableview, scrollview, storyboard.

build.settings has (the android part):

    android =

    {

        versionCode = “11”,

        usesPermissions =

        {

            “android.permission.INTERNET”,

            “android.permission.WRITE_EXTERNAL_STORAGE”, --should let use of photolib/camera, no?!

            “android.permission.ACCESS_FINE_LOCATION”,

            “android.permission.ACCESS_COURSE_LOCATION”,

        },   

    }, 

/BK

At this point, I think it’s clear that we need to get logs from the machine. I have been running hundreds of tests on my dev devices and I can identify the issues encountered on each by using the device logs. 

It looks like there are quite a few moving parts involved in your app, from what you describe above. Have you tried disabling some of these features and just running a barebones app? That might give you the ability to identify the issue by subtraction.

Well, I emptyed my build.settings and config.lua and in main.lua I only have one background loaded and displayed.

That’s it nothing else. Still getting the same error.

/BK

this is my main.lua:

local viewableScreenW = display.viewableContentWidth or 320;

local viewableScreenH = display.viewableContentHeight or 480;

  – load bg

  local image = display.newImageRect( “bg.png”, viewableScreenW , viewableScreenH )

  image.anchorX = 0.5;

  image.anchorY = 0.5;

  image.x= viewableScreenW * 0.5;

  image.y= viewableScreenH * 0.5;

I’d suggest using different x/y coordinates for testing. Something like display.contentWidth and display.contentHeight.

in main, there was network detection code, notifying user that he lost internet, and gps reading the long/lat.

main.lua then forwarded to a loaderscene loading stuff, but at the moment the version I am using is: Version 2013.2060 (2013.07.15)

with the above main.lua not forwarding nor reading network/gps status.

and no there are no moving parts.

/BK

using display.contentWidth and / display.contentHeight did not change anything, still error.

/BK

I believe previously you referenced that you were getting a black screen. Are you now receiving an error, or are you saying the black screen is your error?