Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. OpenGL QWindow Example crashes on Android (SOLVED)
Forum Updated to NodeBB v4.3 + New Features

OpenGL QWindow Example crashes on Android (SOLVED)

Scheduled Pinned Locked Moved Mobile and Embedded
12 Posts 2 Posters 4.6k Views 1 Watching
  • 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.
  • T Offline
    T Offline
    Triebr
    wrote on last edited by
    #3

    Can you elaborate on how you solved that? I'm having the same problem and I don't understand what you mean by adding Qt5OpenGL in libraries.

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZeAL0T
      wrote on last edited by
      #4

      The problem was caused by the missing Qt OpenGL Shared library (or shared object *.so). It should be bundled in the apk file. Check your "Run" configuration in "Projects" mode. There are should be check boxes with libraries names. OpenGL should be checked.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Triebr
        wrote on last edited by
        #5

        I went into the "Run" configuration and I don't see any check boxes for libraries. I'm using Qt 5.2 so maybe that has changed but I see a radio button that says "Bundle QT libraries in APK" which is checked. Then there is a list of "Additional Libraries "which I added
        "C:/Qt/Qt5.2.0-android/5.2.0/android_armv7/lib/libQt5OpenGL.so"
        But I'm still getting the error. Perhaps I should open a new thread

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZeAL0T
          wrote on last edited by
          #6

          Interface of QtCreator 3.0 is slightly different and it doesn't contain the check boxes for libraries like it was in QtCreator 2.x. You can use "this manual":http://qt-project.org/doc/qtcreator-3.0/creator-deploying-android.html#packaging-qt-5-applications

          Maybe your problem is not the same as I had.

          I can advise you to make the next steps:
          Check is your Qt version was built with OpenGL support
          Check is your *.pro file contain QT += opengl
          Check is your apk archive contain all necessary libraries (via a default archiver)

          1 Reply Last reply
          0
          • T Offline
            T Offline
            Triebr
            wrote on last edited by
            #7

            I previously did not have QT += opengl, but after adding it, there is no effect (error still appears). I opened the .apk file and looked in the library directory and it looks like it contains all of the necessary libraries:

            • libplugins_accessible_libqtaccessiblewidgets.so
            • libplugins_imageformats_libqgif.so
            • libplugins_imageformats_libqico.so
            • libplugins_imageformats_libqjpeg.so
            • libplugins_imageformats_libqmng.so
            • libplugins_imageformats_libqtga.so
            • libplugins_imageformats_libqtiff.so
            • libplugins_imageformats_libqwbmp.so
            • libplugins_platforms_android_libqtforandroid.so
            • libplugins_platforms_android_libqtforandroidGL.so
            • libplugins_platforms_libqminimal.so
            • libplugins_platforms_libqoffscreen.so
            • libQt5Core.so
            • libQt5Gui.so
            • libQt5OpenGL.so
            • libQt5Widgets.so
            • libQtGameLib.so

            As for the last one, how can I check if OpenGL is supported? I'm using the 5.2.0 for Android (Windows 32-bit) installer from the main downloads page, I would assume that build has OpenGL support, but it's possible that it does not include OpenGL support.

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              ZeAL0T
              wrote on last edited by
              #8

              Looks like you have all the required libraries in your apk.
              It seems that the problem in the code itself.
              Try to run a Qt example with OpenGL for android (OpenGL Window Example will be the best).
              Is it work fine on the device?

              1 Reply Last reply
              0
              • T Offline
                T Offline
                Triebr
                wrote on last edited by
                #9

                I opened the OpenGL Window project and ran on Android, and it crashes with the same error. The only thing I can think of is that the Android binaries on the main download page were not built with openGL support for some reason. I suppose I can try compiling the android binaries with openGL support.

                1 Reply Last reply
                0
                • Z Offline
                  Z Offline
                  ZeAL0T
                  wrote on last edited by
                  #10

                  I used "Qt 5.2.0 for Android (Windows 32-bit)":http://download.qt-project.org/official_releases/qt/5.2/5.2.0/qt-windows-opensource-5.2.0-android-x86-win32-offline.exe and it really has the problem you are talking about.
                  I fixed it by adding "QT += opengl" in the openglwindow.pro file and rebuilt it.
                  After that it works just fine.

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    Triebr
                    wrote on last edited by
                    #11

                    Oh! I tried the same thing earlier and it didn't work, but I retried it and it works now. I must have rebuilt it improperly the first time (probably didn't run qmake again).

                    Thanks so much for you help working great now

                    1 Reply Last reply
                    0
                    • Z Offline
                      Z Offline
                      ZeAL0T
                      wrote on last edited by
                      #12

                      You are welcome.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved