Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    Qt5 on Android - missing QtActivityDelegate

    Mobile and Embedded
    3
    5
    5403
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      khardix last edited by

      Hello,
      I recently build (according to "wiki instructions":https://qt-project.org/wiki/Qt5ForAndroidBuilding) a Qt5 for android. Now I can successfully build an app, but when I try to deploy it on my SE MK16i (Xperia Pro), all I get is error message "Your application has encountered a fatal error and will be terminated".

      From the java exception trace, it seems that class told QtActionDelegate is missing:
      @W/System.err( 7479): java.lang.ClassNotFoundException: org.qtproject.qt5.android.QtActivityDelegate
      W/System.err( 7479): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
      W/System.err( 7479): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
      W/System.err( 7479): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
      W/System.err( 7479): at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:194)
      W/System.err( 7479): at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:485)
      W/System.err( 7479): at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:689)
      W/System.err( 7479): at android.app.Activity.performCreate(Activity.java:4465)
      W/System.err( 7479): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
      W/System.err( 7479): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
      W/System.err( 7479): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
      W/System.err( 7479): at android.app.ActivityThread.access$600(ActivityThread.java:127)
      W/System.err( 7479): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
      W/System.err( 7479): at android.os.Handler.dispatchMessage(Handler.java:99)
      W/System.err( 7479): at android.os.Looper.loop(Looper.java:137)
      W/System.err( 7479): at android.app.ActivityThread.main(ActivityThread.java:4441)
      W/System.err( 7479): at java.lang.reflect.Method.invokeNative(Native Method)
      W/System.err( 7479): at java.lang.reflect.Method.invoke(Method.java:511)
      W/System.err( 7479): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
      W/System.err( 7479): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
      W/System.err( 7479): at dalvik.system.NativeStart.main(Native Method)
      D/dalvikvm( 7479): GC_CONCURRENT freed 243K, 5% free 9021K/9415K, paused 3ms+5ms@

      Is there any mistake on my side, or is it common and I should wait for more stable version?

      Thanks in advance for any reply.
      Regards,
      Jan 'Khardix' Stanek

      1 Reply Last reply Reply Quote 0
      • D
        davidbak last edited by

        I have this problem too. Looks like QtAndroid.jar isn't deployed. Nor is any other part of Qt.

        So: Go to the projects window/build&run pane/select "run" from the "Android for arm" tab (this UI is wierd). Under "deploy configurations" select "Deploy local Qt libraries" and leave "Use local Qt libraries" checked.

        This copies all kinds of .so files and a few jar files onto the device under /data/local/tmp/qt.

        Gets me farther anyway: Now I see in logcat:

        W/System.err( 8293): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1891]: 109 could not load needed library 'libgnustl_shared.so' for 'libQt5Core.so' (load_library[1093]: Library 'libgnustl_shared.so' not found)

        But in fact libgnustl_shared.so is one of the files just copied into /data/local/tmp/qt/lib, which is also the location it just found libQt5Core.so.

        So what's next? -- David

        1 Reply Last reply Reply Quote 0
        • D
          davidbak last edited by

          (Possibly related to "QTCREATORBUG-9291":https://bugreports.qt-project.org/browse/QTCREATORBUG-9291 except I was using "Deploy Local Qt Libraries" which that bug says works properly.)

          1 Reply Last reply Reply Quote 0
          • D
            davidbak last edited by

            BTW, I'm still trying to get my simple example QML-style application to run.

            The only way I found to get past loading the libraries was to copy all libQt*.so and libgnustl_shared.so to /vendor/lib. Otherwise, it wouldn't load libQtCore.so (and others) due to not finding their built-in dependencies, which apparently used only LD_LIBRARY_PATH which did not have "." in it.

            Now I've got past the loading of my main.qml and get the following error (I should say this is on an actual device, a sort-of TI Blaze clone, not an emulator - haven't tried the emulator).

            W/Qt (29378): kernel/qplatformintegration.cpp:247 (virtual QPlatformOpenGLContext* QPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext*) const): This plugin does not support createPlatformOpenGLContext!
            F/libc (29378): Fatal signal 11 (SIGSEGV) at 0x00000004 (code=1), thread 29411 (.example.Test51)
            I/DEBUG ( 108): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
            I/DEBUG ( 108): Build fingerprint: 'Android/full_blaze/blaze:4.1.2/JZO54K/eng.precor.20130513.102114:userdebug/test-keys'
            I/DEBUG ( 108): pid: 29378, tid: 29411, name: .example.Test51 >>> org.qtproject.example.Test51 <<<
            I/DEBUG ( 108): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000004
            I/DEBUG ( 108): r0 00000000 r1 5e447ea0 r2 00000001 r3 00000000
            I/DEBUG ( 108): r4 5e447ea0 r5 00000000 r6 5a570c70 r7 5e447d74
            I/DEBUG ( 108): r8 5be3d0f0 r9 5bbf90cc sl 00000000 fp 5e447e7c
            I/DEBUG ( 108): ip 5dfd6724 sp 5e447bf0 lr 5deef999 pc 5dd08d2a cpsr 00000130
            I/DEBUG ( 108): d0 6e6f434c476e6574 d1 74726f7070757365
            I/DEBUG ( 108): d2 5065746165726378 d3 4f6d726f66746174
            I/DEBUG ( 108): d4 726765746e496d72 d5 633a3a6e6f697461
            I/DEBUG ( 108): d6 616c506574616572 d7 65704f6d726f6674
            I/DEBUG ( 108): d8 0000000000000000 d9 0000000000000000
            I/DEBUG ( 108): d10 0000000000000000 d11 0000000000000000
            I/DEBUG ( 108): d12 0000000000000000 d13 0000000000000000
            I/DEBUG ( 108): d14 0000000000000000 d15 0000000000000000
            I/DEBUG ( 108): d16 0000000000000000 d17 0000000000000000
            I/DEBUG ( 108): d18 0000000000000000 d19 0000000000000000
            I/DEBUG ( 108): d20 991f1f1f991f1f1f d21 991f1f1f991f1f1f
            I/DEBUG ( 108): d22 0707070703030303 d23 0000001700000016
            I/DEBUG ( 108): d24 0067006700670067 d25 0067006700670067
            I/DEBUG ( 108): d26 0067006700670067 d27 0067006700670067
            I/DEBUG ( 108): d28 0100010001000100 d29 0100010001000100
            I/DEBUG ( 108): d30 0002aaa80002aaa8 d31 0002aaa80002aaa8
            I/DEBUG ( 108): scr 60000010
            I/DEBUG ( 108):
            I/DEBUG ( 108): backtrace:
            I/DEBUG ( 108): #00 pc 0009ed2a /system/vendor/lib/libQt5Gui.so (QOpenGLContext::makeCurrent(QSurface*)+9)
            I/DEBUG ( 108): #01 pc 00097995 /system/vendor/lib/libQt5Quick.so (QSGGuiThreadRenderLoop::renderWindow(QQuickWindow*)+124)
            I/DEBUG ( 108): #02 pc 00097db7 /system/vendor/lib/libQt5Quick.so (QSGGuiThreadRenderLoop::exposureChanged(QQuickWindow*)+36)
            I/DEBUG ( 108): #03 pc 000a5595 /system/vendor/lib/libQt5Quick.so (QQuickWindow::exposeEvent(QExposeEvent*)+14)
            I/DEBUG ( 108): #04 pc 0009094d /system/vendor/lib/libQt5Gui.so (QWindow::event(QEvent*)+148)
            I/DEBUG ( 108): #05 pc 001144e9 /data/local/tmp/qt/lib/libQt5Core.so (QCoreApplicationPrivate::notify_helper(QObject*, QEvent*)+40)
            I/DEBUG ( 108): #06 pc 00114533 /data/local/tmp/qt/lib/libQt5Core.so (QCoreApplication::notify(QObject*, QEvent*)+70)
            I/DEBUG ( 108): #07 pc 00114319 /data/local/tmp/qt/lib/libQt5Core.so (QCoreApplication::notifyInternal(QObject*, QEvent*)+60)

            1 Reply Last reply Reply Quote 0
            • M
              MyQtAccount last edited by

              I had qtactivitydelegate was missing. After deleting my android folder in the project the error went away. I saw the newly generated manifest file had qt5 specific changes:

              <application android:label="@string/app_name" android:name="org.qtproject.qt5.android.bindings.QtApplication"><activity android:screenOrientation="landscape" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:label="@string/app_name" android:configChanges="orientation|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity">

              So that could be the issue.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post