Android QWidget app displays "application encountered a fatal error" after starting emulator?



  • Android newbie here.

    I used Qt 5.3.1 to make a simple "Hello World" Qt widgets application containing a single button. It runs on Windows, OS X, and iOS simulators.

    When I debug application on my x86 Atom on an Nexus 7 Android Virtual Device emulator, the "Hello World" title bar appears. The main screen below remains black. One minute later the following popup displays. Closing popup results in title bar disappearing:

    "Your application encountered a fatal error and cannot continue"

    All troubleshooting tips are appreciated.

    The AVD runs a Java app from Eclipse ADT just fine:

    • AVD Target: Android 4.0.3 - API Level 15
    • AVD CPU/ABI: Intel Atom (x86)
    • AVD Memory: RAM: 2048, VM HEAP: 64
    • AVD SD Card: Size 32 MiB

    1 - Could it be a libQT*.so dependency issue? How does Qt Creator auto-magically deploy libQT*.so dependencies to the AVD?

    2 - How do you debug Qt on an Android AVD? Is there a log file someplace?

    Thanks in advance,

    -Ed

    Host Machine: OSX 10.9.4
    QT 5.3.1



  • I figured out to make Eclipse show me Android->LogCat view.

    I see the following FATAL EXCEPTION appear in LogCat near the time the error appears:

    LogCat displays sleep and pong messages for about a minute:
    @
    07-18 09:53:16.609: I/Qt JAVA(1671): DEBUGGER: go to sleep
    07-18 09:53:16.819: I/Qt JAVA(1671): DEBUGGER: waiting for pong at /data/local/tmp/qt/debug-pong-org.qtproject.example.qt_android_hello, attempt 147
    07-18 09:53:16.819: I/Qt JAVA(1671): DEBUGGER: go to sleep
    07-18 09:53:17.028: I/Qt JAVA(1671): DEBUGGER: waiting for pong at /data/local/tmp/qt/debug-pong-org.qtproject.example.qt_android_hello, attempt 148
    07-18 09:53:17.028: I/Qt JAVA(1671): DEBUGGER: go to sleep
    07-18 09:53:17.229: I/Qt JAVA(1671): DEBUGGER: waiting for pong at /data/local/tmp/qt/debug-pong-org.qtproject.example.qt_android_hello, attempt 149
    07-18 09:53:17.229: I/Qt JAVA(1671): DEBUGGER: go to sleep
    07-18 09:53:17.439: I/Qt JAVA(1671): DEBUGGER: time out when waiting for pong file
    @
    Then after a minute the following exception appears in LogCat and fatal error message display in Android emulator:
    @
    07-18 09:53:17.439: W/System.err(1671): java.lang.Exception:
    07-18 09:53:17.439: W/System.err(1671): at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:254)
    07-18 09:53:17.439: W/System.err(1671): at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:644)
    07-18 09:53:17.439: W/System.err(1671): at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:875)
    07-18 09:53:17.439: W/System.err(1671): at android.app.Activity.performCreate(Activity.java:4465)
    07-18 09:53:17.439: W/System.err(1671): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
    07-18 09:53:17.439: W/System.err(1671): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
    07-18 09:53:17.439: W/System.err(1671): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
    07-18 09:53:17.439: W/System.err(1671): at android.app.ActivityThread.access$600(ActivityThread.java:123)
    07-18 09:53:17.439: W/System.err(1671): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
    07-18 09:53:17.439: W/System.err(1671): at android.os.Handler.dispatchMessage(Handler.java:99)
    07-18 09:53:17.439: W/System.err(1671): at android.os.Looper.loop(Looper.java:137)
    07-18 09:53:17.439: W/System.err(1671): at android.app.ActivityThread.main(ActivityThread.java:4424)
    07-18 09:53:17.439: W/System.err(1671): at java.lang.reflect.Method.invokeNative(Native Method)
    07-18 09:53:17.439: W/System.err(1671): at java.lang.reflect.Method.invoke(Method.java:511)
    07-18 09:53:17.439: W/System.err(1671): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
    07-18 09:53:17.439: W/System.err(1671): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    07-18 09:53:17.439: W/System.err(1671): at dalvik.system.NativeStart.main(Native Method)
    07-18 09:53:17.449: D/dalvikvm(1671): GC_CONCURRENT freed 490K, 5% free 12784K/13319K, paused 0ms+1ms
    07-18 09:53:17.449: D/libEGL(1671): loaded /system/lib/egl/libGLES_android.so
    07-18 09:53:17.449: D/libEGL(1671): loaded /system/lib/egl/libEGL_emulation.so
    07-18 09:53:17.449: D/(1671): HostConnection::get() New Host Connection established 0x94fb000, tid 1671
    07-18 09:53:17.459: D/libEGL(1671): loaded /system/lib/egl/libGLESv1_CM_emulation.so
    07-18 09:53:17.459: D/libEGL(1671): loaded /system/lib/egl/libGLESv2_emulation.so
    07-18 09:53:17.468: W/EGL_emulation(1671): eglSurfaceAttrib not implemented
    07-18 09:53:17.468: D/OpenGLRenderer(1671): Enabling debug mode 0
    07-18 09:53:17.479: W/EGL_emulation(1671): eglSurfaceAttrib not implemented
    07-18 09:53:17.519: D/(784): HostConnection::get() New Host Connection established 0x8b656c0, tid 1042
    07-18 09:53:17.529: I/ActivityManager(876): Displayed org.qtproject.example.qt_android_hello/org.qtproject.qt5.android.bindings.QtActivity: +32s46ms
    07-18 09:53:17.539: W/NetworkManagementSocketTagger(876): setKernelCountSet(10012, 0) failed with errno -2

    @



  • Does Qt 5.3.1 widget apps work with Android? Should roll-back to Qt 5.2.1?

    The messages following the exception refer to QtActivity. Is that a useful clue or just means it crashed shortly after starting?

    -Ed


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.