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

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

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.