problem compiling an opengl application for android



  • I installed qt-opensource-windows-x86-android-5.8.0. Try the standard examples to compile under android. With the usual examples there are no errors everything works (for example, Qt Quick Control 2). But the examples from the opengl issue an error. A year ago such problems did not arise. For definiteness, an example of a shadow-map-qml (with other opengl examples of the same error)

    Запуск внешнего процесса.I art : Not late-enabling -Xcheck:jni (already on)
    W System : ClassLoader referenced unknown path:
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt5Gui.so: unused DT entry: type 0x1d arg 0x534cf
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt5Gui.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt5Network.so: unused DT entry: type 0x1d arg 0x131f2
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt5Network.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DCore.so: unused DT entry: type 0x1d arg 0xd015
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DCore.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt5Concurrent.so: unused DT entry: type 0x1d arg 0xc13
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt5Concurrent.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DRender.so: unused DT entry: type 0x1d arg 0x25095
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DRender.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt5Gamepad.so: unused DT entry: type 0x1d arg 0x32b3
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt5Gamepad.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DInput.so: unused DT entry: type 0x1d arg 0xaf20
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DInput.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DLogic.so: unused DT entry: type 0x1d arg 0x196d
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DLogic.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DExtras.so: unused DT entry: type 0x1d arg 0xd7c7
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DExtras.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt5Qml.so: unused DT entry: type 0x1d arg 0x34545
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt5Qml.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt5Quick.so: unused DT entry: type 0x1d arg 0x46bc9
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt5Quick.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt5QuickParticles.so: unused DT entry: type 0x1d arg 0x5466
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt5QuickParticles.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DQuick.so: unused DT entry: type 0x1d arg 0x5d77
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DQuick.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DQuickExtras.so: unused DT entry: type 0x1d arg 0x1840
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DQuickExtras.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DQuickRender.so: unused DT entry: type 0x1d arg 0x823a
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DQuickRender.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DQuickInput.so: unused DT entry: type 0x1d arg 0x2925
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libQt53DQuickInput.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/platforms/android/libqtforandroid.so: unused DT entry: type 0x1d arg 0x94a3
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/platforms/android/libqtforandroid.so: unsupported flags DT_FLAGS_1=0x81
    I Qt : qt start
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/bearer/libqandroidbearer.so: unused DT entry: type 0x1d arg 0x1712
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/bearer/libqandroidbearer.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/gamepads/libandroidgamepad.so: unused DT entry: type 0x1d arg 0x1306
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/gamepads/libandroidgamepad.so: unsupported flags DT_FLAGS_1=0x81
    I art : Background sticky concurrent mark sweep GC freed 13567(1543KB) AllocSpace objects, 5(104KB) LOS objects, 57% free, 1555KB/3MB, paused 7.832ms total 133.170ms
    I art : Background partial concurrent mark sweep GC freed 8531(1247KB) AllocSpace objects, 18(364KB) LOS objects, 39% free, 2MB/3MB, paused 3.054ms total 119.771ms
    W linker : /data/app/org.qtproject.example.shadow_map_qml-1/lib/arm/libshadow-map-qml.so: unused DT entry: type 0xf arg 0x648
    D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
    D : HostConnection::get() New Host Connection established 0xac1059e0, tid 6677
    D : HostConnection::get() New Host Connection established 0xac105990, tid 6694
    I OpenGLRenderer: Initialized EGL, version 1.4
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/sceneparsers/libgltfsceneio.so: unused DT entry: type 0x1d arg 0x275d
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/sceneparsers/libgltfsceneio.so: unsupported flags DT_FLAGS_1=0x81
    D : HostConnection::get() New Host Connection established 0xac107510, tid 6699
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/QtQuick.2/libqtquick2plugin.so: unused DT entry: type 0x1d arg 0x4de
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/QtQuick.2/libqtquick2plugin.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Core/libquick3dcoreplugin.so: unused DT entry: type 0x1d arg 0x16d2
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Core/libquick3dcoreplugin.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Render/libquick3drenderplugin.so: unused DT entry: type 0x1d arg 0x8918
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Render/libquick3drenderplugin.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Input/libquick3dinputplugin.so: unused DT entry: type 0x1d arg 0x2943
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Input/libquick3dinputplugin.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Extras/libquick3dextrasplugin.so: unused DT entry: type 0x1d arg 0x1932
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Extras/libquick3dextrasplugin.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Logic/libquick3dlogicplugin.so: unused DT entry: type 0x1d arg 0x881
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Logic/libquick3dlogicplugin.so: unsupported flags DT_FLAGS_1=0x81
    D : HostConnection::get() New Host Connection established 0xa3788400, tid 6695
    W libshadow-map-qml.so: (null):0 ((null)): QOpenGLTexture::setMipBaseLevel: requires OpenGL >= 1.2 or OpenGL ES >= 3.0
    W libshadow-map-qml.so: (null):0 ((null)): QOpenGLTexture::setMipMaxLevel: requires OpenGL >= 1.2 or OpenGL ES >= 3.0
    D gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread)
    D : HostConnection::get() New Host Connection established 0xa3788400, tid 6695
    D gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread)
    D : HostConnection::get() New Host Connection established 0xa3788400, tid 6695
    D gralloc_ranchu: gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread)
    D : HostConnection::get() New Host Connection established 0xa3788400, tid 6695
    E Surface : getSlotFromBufferLocked: unknown buffer: 0xac872a20
    E EGL_emulation: rcMakeCurrent returned EGL_FALSE
    E EGL_emulation: tid 6699: eglMakeCurrent(1070): error 0x3006 (EGL_BAD_CONTEXT)
    E libEGL : eglMakeCurrent:809 error 3006 (EGL_BAD_CONTEXT)
    W libshadow-map-qml.so: (null):0 ((null)): QEGLPlatformContext: eglMakeCurrent failed: 3006
    E libEGL : call to OpenGL ES API with no current context (logged once per thread)
    W libshadow-map-qml.so: (null):0 ((null)): Failed to make context current: OpenGL resources will not be destroyed
    W libshadow-map-qml.so: (null):0 ((null)): Texture is not valid in the current context.
    W libshadow-map-qml.so: Texture has not been destroyed

    «org.qtproject.example.shadow_map_qml» аварийно завершился.
    Запуск внешнего процесса.I art : Not late-enabling -Xcheck:jni (already on)
    W System : ClassLoader referenced unknown path:
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt5Gui.so: unused DT entry: type 0x1d arg 0x534cf
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt5Gui.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt5Network.so: unused DT entry: type 0x1d arg 0x131f2
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt5Network.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DCore.so: unused DT entry: type 0x1d arg 0xd015
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DCore.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt5Concurrent.so: unused DT entry: type 0x1d arg 0xc13
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt5Concurrent.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DRender.so: unused DT entry: type 0x1d arg 0x25095
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DRender.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt5Gamepad.so: unused DT entry: type 0x1d arg 0x32b3
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt5Gamepad.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DInput.so: unused DT entry: type 0x1d arg 0xaf20
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DInput.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DLogic.so: unused DT entry: type 0x1d arg 0x196d
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DLogic.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DExtras.so: unused DT entry: type 0x1d arg 0xd7c7
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DExtras.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt5Qml.so: unused DT entry: type 0x1d arg 0x34545
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt5Qml.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt5Quick.so: unused DT entry: type 0x1d arg 0x46bc9
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt5Quick.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt5QuickParticles.so: unused DT entry: type 0x1d arg 0x5466
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt5QuickParticles.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DQuick.so: unused DT entry: type 0x1d arg 0x5d77
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DQuick.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DQuickExtras.so: unused DT entry: type 0x1d arg 0x1840
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DQuickExtras.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DQuickRender.so: unused DT entry: type 0x1d arg 0x823a
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DQuickRender.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DQuickInput.so: unused DT entry: type 0x1d arg 0x2925
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libQt53DQuickInput.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/platforms/android/libqtforandroid.so: unused DT entry: type 0x1d arg 0x94a3
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/platforms/android/libqtforandroid.so: unsupported flags DT_FLAGS_1=0x81
    I Qt : qt start
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/bearer/libqandroidbearer.so: unused DT entry: type 0x1d arg 0x1712
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/bearer/libqandroidbearer.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/gamepads/libandroidgamepad.so: unused DT entry: type 0x1d arg 0x1306
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/gamepads/libandroidgamepad.so: unsupported flags DT_FLAGS_1=0x81
    I art : Background sticky concurrent mark sweep GC freed 13619(1545KB) AllocSpace objects, 5(104KB) LOS objects, 57% free, 1538KB/3MB, paused 2.053ms total 117.677ms
    I art : Background partial concurrent mark sweep GC freed 8546(1248KB) AllocSpace objects, 18(364KB) LOS objects, 40% free, 2MB/3MB, paused 3.332ms total 128.795ms
    W linker : /data/app/org.qtproject.example.shadow_map_qml-2/lib/arm/libshadow-map-qml.so: unused DT entry: type 0xf arg 0x7d2
    D : (null):0 ((null)): QML debugging is enabled. Only use this in a safe environment.
    D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
    D : HostConnection::get() New Host Connection established 0xac105ad0, tid 6796
    D : HostConnection::get() New Host Connection established 0xac105b70, tid 6813
    I OpenGLRenderer: Initialized EGL, version 1.4
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/sceneparsers/libgltfsceneio.so: unused DT entry: type 0x1d arg 0x275d
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/plugins/sceneparsers/libgltfsceneio.so: unsupported flags DT_FLAGS_1=0x81
    D : HostConnection::get() New Host Connection established 0xac106bb0, tid 6818
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/QtQuick.2/libqtquick2plugin.so: unused DT entry: type 0x1d arg 0x4de
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/QtQuick.2/libqtquick2plugin.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Core/libquick3dcoreplugin.so: unused DT entry: type 0x1d arg 0x16d2
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Core/libquick3dcoreplugin.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Render/libquick3drenderplugin.so: unused DT entry: type 0x1d arg 0x8918
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Render/libquick3drenderplugin.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Input/libquick3dinputplugin.so: unused DT entry: type 0x1d arg 0x2943
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Input/libquick3dinputplugin.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Extras/libquick3dextrasplugin.so: unused DT entry: type 0x1d arg 0x1932
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Extras/libquick3dextrasplugin.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Logic/libquick3dlogicplugin.so: unused DT entry: type 0x1d arg 0x881
    W linker : /data/data/org.qtproject.example.shadow_map_qml/qt-reserved-files/qml/Qt3D/Logic/libquick3dlogicplugin.so: unsupported flags DT_FLAGS_1=0x81
    D : HostConnection::get() New Host Connection established 0xa393a058, tid 6814
    W libshadow-map-qml.so: (null):0 ((null)): QOpenGLTexture::setMipBaseLevel: requires OpenGL >= 1.2 or OpenGL ES >= 3.0
    W libshadow-map-qml.so: (null):0 ((null)): QOpenGLTexture::setMipMaxLevel: requires OpenGL >= 1.2 or OpenGL ES >= 3.0

    Found this link http://docs.huihoo.com/qt/5.x/platform-notes-android.html
    OpenGL Special Considerations
    There are some special considerations to be made when OpenGL is used. The platform plugin only supports full screen top-level OpenGL windows. This means that even dialogs and popups will be shown as full screen. There may also be drawing errors if you try to stack windows that have animations or otherwise require updating their UI while they are obscured by another window.
    It is recommended that you try to avoid multiple top-level windows in the case of Android apps, as there is no traditional window system on this platform.
    Note: Embedding a QGLWidget inside a widget hierarchy is not supported. When QGLWidget is in use, it must be the top-level widget.
    Note: Avoid using the legacy QGLWidget. For embedding OpenGL or Qt Quick content into a widget-based user interface, prefer using QOpenGLWidget and QQuickWidget.
    Modern devices often support OpenGL ES 3.0 or 3.1 in addition to 2.0. To get a suitable OpenGL context, set the requested version via QSurfaceFormat::setVersion(). Note however that the header files are only available in recent API levels, for example to include gl31.h, you need to target API level 21. Keep in mind also that using OpenGL ES 3.x features will result in the application breaking on older devices that only support 2.0.

    Changed main.c so

    #include <Qt3DQuickExtras/qt3dquickwindow.h>
    #include <Qt3DQuick/QQmlAspectEngine>
    #include <QGuiApplication>
    #include <QQmlContext>
    #include <QQmlEngine>
    #include <QSurfaceFormat> //here
    #include <QOpenGLExtraFunctions> //here
    
    
    int main(int argc, char* argv[])
    {
        QSurfaceFormat fmt; //here
        fmt.setVersion(3, 0); //here
        fmt.setDepthBufferSize(24); //here
        QSurfaceFormat::setDefaultFormat(fmt); //here
    
        QGuiApplication::setAttribute(Qt::AA_UseOpenGLES); //here
    
        QGuiApplication app(argc, argv);
    
        Qt3DExtras::Quick::Qt3DQuickWindow view;
        view.setFormat(fmt); //here
        view.resize(1280, 720);
        view.engine()->qmlEngine()->rootContext()->setContextProperty("_window", &view);
        view.setSource(QUrl("qrc:/main.qml"));
        view.show();
    
        return app.exec();
    }
    

    But the error remained. Please help me



  • Do you run the app on an AVD? I wasn't able to to so and got similar errors. I tried it on a high-end physical device with Android 6.0 and it worked.


Log in to reply
 

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