[SOLVED] Running/Testing Qt Quick 2.0 application on Android



  • Another newbie's question...

    I have a Qt Quick 2.0 application, which I can run on the desktop OK with Qt Creator 3.0.1. I was able to cross-compile it under Mac OS 10.8.5 for Android. I have some problems running it.

    Once I finally found out how to actually run it on my Galaxy SIII (Android version 4.3), everything seemed to load happily (a more prominent progress bar would be nice, since it doesn't seem like anything is happening), but the application output had this in it:
    @D/dalvikvm(15783): Added shared lib /data/app-lib/org.qtproject.example.WeightPlateQtQ-1/libWeightPlateQtQ.so 0x422da4b0
    D/dalvikvm(15783): No JNI_OnLoad found in /data/app-lib/org.qtproject.example.WeightPlateQtQ-1/libWeightPlateQtQ.so 0x422da4b0, skipping init
    D/libEGL (15783): loaded /system/lib/egl/libEGL_adreno200.so
    D/libEGL (15783): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
    D/libEGL (15783): loaded /system/lib/egl/libGLESv2_adreno200.so
    I/Adreno200-EGL(15783): <qeglDrvAPI_eglInitialize:265>: EGL 1.4 QUALCOMM build: HAREESHG_Nondeterministic_AU+PATCH[ES]_msm8960_JB_1.9.6_MR2_CL3219408_release_ENGG (CL3219408)
    I/Adreno200-EGL(15783): Build Date: 09/28/13 Sat
    I/Adreno200-EGL(15783): Local Branch: hhh
    I/Adreno200-EGL(15783): Remote Branch: quic/jb_1.9.6_1
    I/Adreno200-EGL(15783): Local Patches: 8d50ec23e42ef52b570aa6ff1650afac0b503d78 CL3219408: Fix in the Glreadpixels for negative offsets and larger dimensions.
    I/Adreno200-EGL(15783): 801859126f6ca69482b39a34ca61447e3f7cded8 rb: fix panel settings to clear undrawn/undefined buffers
    I/Adreno200-EGL(15783): Reconstruct Branch: LOCAL_PATCH[ES]
    D/OpenGLRenderer(15783): Enabling debug mode 0
    W/Qt (15783): file:///data/data/org.qtproject.example.WeightPlateQtQ/files/qml/WeightPlateQtQ/main.qml:-1 ((null)): file:///data/data/org.qtproject.example.WeightPlateQtQ/files/qml/WeightPlateQtQ/main.qml: File not found
    W/Qt (15783): ../src/androidjnimain.cpp:695 (void updateWindow(JNIEnv*, jobject)): updateWindow: Dirty screen not implemented yet on OpenGL@

    The Samsung started running the app (yay!) but all that appeared was a white screen (boo!). I can't tell where the main.qml cited in the messages above is supposed to be that couldn't be found (it's in the project). I could see no <code>/data</code> directory on the phone. And "Dirty screen" has no meaning to me at this point.

    If I try running under the emulator (AVD_for_Galaxy_Nexus_by_Google, Android 4.3, ABI:armeabi-v7a armeabi), I get the same white screen, but a different set of interesting messages:
    @I/Choreographer( 875): Skipped 48 frames! The application may be doing too much work on its main thread.
    D/gralloc_goldfish( 875): Emulator without GPU emulation detected.
    D/libEGL ( 875): Emulator without GPU support detected. Fallback to software renderer.
    D/libEGL ( 875): loaded /system/lib/egl/libGLES_android.so
    W/Qt ( 875): file:///data/data/org.qtproject.example.WeightPlateQtQ/files/qml/WeightPlateQtQ/main.qml:-1 ((null)): file:///data/data/org.qtproject.example.WeightPlateQtQ/files/qml/WeightPlateQtQ/main.qml: File not found
    W/Qt ( 875): eglconvenience/qeglconvenience.cpp:289 (void* QEglConfigChooser::chooseConfig()): Cant find EGLConfig, returning null config
    W/Qt ( 875): eglconvenience/qeglconvenience.cpp:289 (void* QEglConfigChooser::chooseConfig()): Cant find EGLConfig, returning null config
    W/Qt ( 875): scenegraph/qsgcontext.cpp:472 (virtual void QSGRenderContext::initialize(QOpenGLContext*)): QSGContext::initialize: depth buffer support missing, expect rendering errors
    W/Qt ( 875): scenegraph/qsgcontext.cpp:474 (virtual void QSGRenderContext::initialize(QOpenGLContext*)): QSGContext::initialize: stencil buffer support missing, expect rendering errors
    E/libEGL ( 875): called unimplemented OpenGL ES API@

    Does thing ring any bells with anyone?

    Thanks!

    -Eric


  • Moderators

    You are probably deploying standalone QML files, and not using the QRC (Qt Resource System), right? I think both approaches are valid, but due to restrictions on mobile platforms, deployment using QRC is much easier (it compiles the QML files into the binary executable).



  • 'tis true, I am using standalone QML files... but isn't that supposed to work automagically? I'm probably naive, but I thought if I clicked "Run" and chose an Android device/emulator, that Creator knew what to do. Or is this a bug?

    I'll look into using qrc files.

    Thanks!



  • So, using resources fixed the problem... still wondering why using raw .qml files causes an error and not some alert why "You Can't Do That!"


  • Moderators

    I'm not up-to-date with the Android port, but you are right, there should at least be a warning for this problem.


Log in to reply
 

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