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. Android X86_64 App crashes before reaching Qt main.
Forum Updated to NodeBB v4.3 + New Features

Android X86_64 App crashes before reaching Qt main.

Scheduled Pinned Locked Moved Solved Mobile and Embedded
12 Posts 2 Posters 425 Views
  • 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.
  • SMF-QtS Online
    SMF-QtS Online
    SMF-Qt
    wrote last edited by
    #1

    Ref: [https://forum.qt.io/topic/162533/testing-android-apk-with-qtcreator-fails-with-an-error]

    The Qt Version is 6.9.1 and my test app builds and deploys ok, but when I start the debugger it crashes before reaching my main():

    15:47:41: Checking available ports...
    15:47:41: Found 31 free ports.
    Art: Clearing App Profiles failed.
    I/.example.QtTes: Late-enabling -Xcheck:jni
    W/.example.QtTes: Unexpected CPU variant for X86 using defaults: x86_64
    D/CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10106; state: ENABLED
    W/ActivityThread: Application org.qtproject.example.QtTest is waiting for the debugger on port 8100...
    I/System.out: Sending WAIT chunk
    Art: Compiled App Profiles.
    I/System.out: Debugger has connected
    I/System.out: waiting for debugger to settle...
    15:47:42: Debugging ...
    I/System.out: waiting for debugger to settle...
    I/System.out: waiting for debugger to settle...
    I/System.out: waiting for debugger to settle...
    I/System.out: debugger has settled (1419)
    V/GraphicsEnvironment: ANGLE Developer option for 'org.qtproject.example.QtTest' set to: 'default'
    V/GraphicsEnvironment: Neither updatable production driver nor prerelease driver is supported.
    D/NetworkSecurityConfig: No Network Security Config specified, using platform default
    D/NetworkSecurityConfig: No Network Security Config specified, using platform default
    D/libEGL : loaded /vendor/lib64/egl/libEGL_emulation.so
    D/libEGL : loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
    D/libEGL : loaded /vendor/lib64/egl/libGLESv2_emulation.so
    E/.example.QtTes: No implementation found for boolean org.qtproject.qt.android.QtNative.updateNativeActivity() (tried Java_org_qtproject_qt_android_QtNative_updateNativeActivity and Java_org_qtproject_qt_android_QtNative_updateNativeActivity__)
    W/.example.QtTes: ClassLoaderContext parent mismatch. (PCL[] | PCL[];PCL[/data/app/~~4kyuH4zPo5erZKIsLXVh1A==/org.qtproject.example.QtTest-VONq6ntAgy2Oe3-2YSpADg==/base.apk368318496:/data/app/~~4kyuH4zPo5erZKIsLXVh1A==/org.qtproject.example.QtTest-VONq6ntAgy2Oe3-2YSpADg==/base.apk!classes2.dex2927964329:/data/app/~~4kyuH4zPo5erZKIsLXVh1A==/org.qtproject.example.QtTest-VONq6ntAgy2Oe3-2YSpADg==/base.apk!classes3.dex*547663153])
    I/QtLoader: Sleeping for 3000ms, helping the native debugger to settle. Use the env QT_ANDROID_DEBUGGER_MAIN_THREAD_SLEEP_MS variable to change this value.
    I/QtCore : Start
    I/Qt : qt started
    I/Choreographer: Skipped 234 frames! The application may be doing too much work on its main thread.
    D/HostConnection: createUnique: call
    D/HostConnection: HostConnection::get() New Host Connection established 0x78d2b929bd90, tid 11162
    D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_vulkan_async_qsri ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_1
    W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
    W/OpenGLRenderer: Failed to initialize 101010-2 format, error = EGL_NOT_INITIALIZED
    F/OpenGLRenderer: Failed to create context, error = EGL_NOT_INITIALIZED
    15:47:47: Debugging of has finished.
    15:47:47: Android target "org.qtproject.example.QtTest" died.

    Qt 6.9.1 was configured as follows:

    configure -prefix /opt/qt-androidX86/ -qt-host-path /opt/qt6/ -android-abis x86_64 -android-sdk /opt/android/sdk/ -android-ndk /opt/android/sdk/ndk/27.2.12479018 -skip qtwebengine -openssl-linked -- -D OPENSSL_ROOT_DIR="/work/Qt-Android/android_openssl/ssl_3/x86_64"

    Suggestions welcome.

    SMF-QtS 1 Reply Last reply
    0
    • SMF-QtS SMF-Qt

      Ref: [https://forum.qt.io/topic/162533/testing-android-apk-with-qtcreator-fails-with-an-error]

      The Qt Version is 6.9.1 and my test app builds and deploys ok, but when I start the debugger it crashes before reaching my main():

      15:47:41: Checking available ports...
      15:47:41: Found 31 free ports.
      Art: Clearing App Profiles failed.
      I/.example.QtTes: Late-enabling -Xcheck:jni
      W/.example.QtTes: Unexpected CPU variant for X86 using defaults: x86_64
      D/CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10106; state: ENABLED
      W/ActivityThread: Application org.qtproject.example.QtTest is waiting for the debugger on port 8100...
      I/System.out: Sending WAIT chunk
      Art: Compiled App Profiles.
      I/System.out: Debugger has connected
      I/System.out: waiting for debugger to settle...
      15:47:42: Debugging ...
      I/System.out: waiting for debugger to settle...
      I/System.out: waiting for debugger to settle...
      I/System.out: waiting for debugger to settle...
      I/System.out: debugger has settled (1419)
      V/GraphicsEnvironment: ANGLE Developer option for 'org.qtproject.example.QtTest' set to: 'default'
      V/GraphicsEnvironment: Neither updatable production driver nor prerelease driver is supported.
      D/NetworkSecurityConfig: No Network Security Config specified, using platform default
      D/NetworkSecurityConfig: No Network Security Config specified, using platform default
      D/libEGL : loaded /vendor/lib64/egl/libEGL_emulation.so
      D/libEGL : loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
      D/libEGL : loaded /vendor/lib64/egl/libGLESv2_emulation.so
      E/.example.QtTes: No implementation found for boolean org.qtproject.qt.android.QtNative.updateNativeActivity() (tried Java_org_qtproject_qt_android_QtNative_updateNativeActivity and Java_org_qtproject_qt_android_QtNative_updateNativeActivity__)
      W/.example.QtTes: ClassLoaderContext parent mismatch. (PCL[] | PCL[];PCL[/data/app/~~4kyuH4zPo5erZKIsLXVh1A==/org.qtproject.example.QtTest-VONq6ntAgy2Oe3-2YSpADg==/base.apk368318496:/data/app/~~4kyuH4zPo5erZKIsLXVh1A==/org.qtproject.example.QtTest-VONq6ntAgy2Oe3-2YSpADg==/base.apk!classes2.dex2927964329:/data/app/~~4kyuH4zPo5erZKIsLXVh1A==/org.qtproject.example.QtTest-VONq6ntAgy2Oe3-2YSpADg==/base.apk!classes3.dex*547663153])
      I/QtLoader: Sleeping for 3000ms, helping the native debugger to settle. Use the env QT_ANDROID_DEBUGGER_MAIN_THREAD_SLEEP_MS variable to change this value.
      I/QtCore : Start
      I/Qt : qt started
      I/Choreographer: Skipped 234 frames! The application may be doing too much work on its main thread.
      D/HostConnection: createUnique: call
      D/HostConnection: HostConnection::get() New Host Connection established 0x78d2b929bd90, tid 11162
      D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_vulkan_async_qsri ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_1
      W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
      W/OpenGLRenderer: Failed to initialize 101010-2 format, error = EGL_NOT_INITIALIZED
      F/OpenGLRenderer: Failed to create context, error = EGL_NOT_INITIALIZED
      15:47:47: Debugging of has finished.
      15:47:47: Android target "org.qtproject.example.QtTest" died.

      Qt 6.9.1 was configured as follows:

      configure -prefix /opt/qt-androidX86/ -qt-host-path /opt/qt6/ -android-abis x86_64 -android-sdk /opt/android/sdk/ -android-ndk /opt/android/sdk/ndk/27.2.12479018 -skip qtwebengine -openssl-linked -- -D OPENSSL_ROOT_DIR="/work/Qt-Android/android_openssl/ssl_3/x86_64"

      Suggestions welcome.

      SMF-QtS Online
      SMF-QtS Online
      SMF-Qt
      wrote last edited by
      #2

      @SMF-Qt

      I have made some progress:

      I updated the JDK to 24.0.1, Gradle to 8.14 and using SDK API 35 things have started to work.
      I have a simple test Qt app that pops up a window with the words "Hello World" on a QLabel and a QPushbutton that closes the app and this works fine with this setup on my simulated test phone.

      My more complicated test App using this setup now builds and deploys to the test phone.
      However it crashes (expected failure) the good news is it is now crashing in my code the bad news is that when the debugger stops at the failure all I get in the debug output is assembler code not the C++ that my app is written in (android studio also complains about missing debug symbols when I try to debug the apk file).

      I believe that when qtcreator deploys the app even though it is a debug build it is stripping the debug info from the apk file.

      What is the correct way to configure qtcreator to stop it doing this?

      SMF-QtS 1 Reply Last reply
      0
      • SMF-QtS SMF-Qt

        @SMF-Qt

        I have made some progress:

        I updated the JDK to 24.0.1, Gradle to 8.14 and using SDK API 35 things have started to work.
        I have a simple test Qt app that pops up a window with the words "Hello World" on a QLabel and a QPushbutton that closes the app and this works fine with this setup on my simulated test phone.

        My more complicated test App using this setup now builds and deploys to the test phone.
        However it crashes (expected failure) the good news is it is now crashing in my code the bad news is that when the debugger stops at the failure all I get in the debug output is assembler code not the C++ that my app is written in (android studio also complains about missing debug symbols when I try to debug the apk file).

        I believe that when qtcreator deploys the app even though it is a debug build it is stripping the debug info from the apk file.

        What is the correct way to configure qtcreator to stop it doing this?

        SMF-QtS Online
        SMF-QtS Online
        SMF-Qt
        wrote last edited by
        #3

        @SMF-Qt

        The updated of my gradle from 8.12 to 8.14 got me a better response from the build process.
        I now sometimes end up on the break point I have set in my main (viewed as C++ not assembler) so the warning from Android Studio may have been a red herring..
        The problem is more likely to do with the mysql plugin in that I now get:

        (qputenv("QT_DEBUG_PLUGINS", QByteArray("1")); is the first line of code in my main())

        D/qt.core.plugin.factoryloader: Got keys from plugin meta data QList("android")
        D/qt.core.plugin.factoryloader: checking directory path "/data/app/~~eTc9EIgL6FFWDkaEV7AuPw==/org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==/base.apk!/lib/x86_64" ...
        D/qt.core.plugin.factoryloader: looking at "libplugins_sqldrivers_qsqlite_x86_64.so"
        D/qt.core.plugin.loader: Found metadata in lib /data/app/~~eTc9EIgL6FFWDkaEV7AuPw==/org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==/base.apk!/lib/x86_64/libplugins_sqldrivers_qsqlite_x86_64.so, metadata=
        D/qt.core.plugin.loader: {
        D/qt.core.plugin.loader: "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        D/qt.core.plugin.loader: "MetaData": {
        D/qt.core.plugin.loader: "Keys": [
        D/qt.core.plugin.loader: "QSQLITE"
        D/qt.core.plugin.loader: ]
        D/qt.core.plugin.loader: },
        D/qt.core.plugin.loader: "archlevel": 2,
        D/qt.core.plugin.loader: "className": "QSQLiteDriverPlugin",
        D/qt.core.plugin.loader: "debug": true,
        D/qt.core.plugin.loader: "version": 395520
        D/qt.core.plugin.loader: }
        D/qt.core.plugin.loader:
        D/qt.core.plugin.loader:
        D/qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QSQLITE")
        D/qt.core.plugin.factoryloader: looking at "libplugins_sqldrivers_qsqlmysql_x86_64.so"
        D/qt.core.plugin.loader: Found metadata in lib /data/app/~~eTc9EIgL6FFWDkaEV7AuPw==/org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==/base.apk!/lib/x86_64/libplugins_sqldrivers_qsqlmysql_x86_64.so, metadata=
        D/qt.core.plugin.loader: {
        D/qt.core.plugin.loader: "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
        D/qt.core.plugin.loader: "MetaData": {
        D/qt.core.plugin.loader: "Keys": [
        D/qt.core.plugin.loader: "QMYSQL",
        D/qt.core.plugin.loader: "QMARIADB"
        D/qt.core.plugin.loader: ]
        D/qt.core.plugin.loader: },
        D/qt.core.plugin.loader: "archlevel": 2,
        D/qt.core.plugin.loader: "className": "QMYSQLDriverPlugin",
        D/qt.core.plugin.loader: "debug": true,
        D/qt.core.plugin.loader: "version": 395520
        D/qt.core.plugin.loader: }
        D/qt.core.plugin.loader:
        D/qt.core.plugin.loader:
        D/qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QMYSQL", "QMARIADB")
        D/qt.core.library: "/data/app/~~eTc9EIgL6FFWDkaEV7AuPw==/org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==/base.apk!/lib/x86_64/libplugins_sqldrivers_qsqlmysql_x86_64.so" cannot load: Cannot load library /data/app/~~eTc9EIgL6FFWDkaEV7AuPw==/org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==/base.apk!/lib/x86_64/libplugins_sqldrivers_qsqlmysql_x86_64.so: dlopen failed: library "data_app~~eTc9EIgL6FFWDkaEV7AuPw==_org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==_base.apk!_lib_x86_64_libplugins_sqldrivers_qsqlmysql_x86_64.so" not found
        D/qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "/data/app/~~eTc9EIgL6FFWDkaEV7AuPw==/org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==/base.apk!/lib/x86_64/libplugins_sqldrivers_qsqlmysql_x86_64.so" : "Cannot load library /data/app/~~eTc9EIgL6FFWDkaEV7AuPw==/org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==/base.apk!/lib/x86_64/libplugins_sqldrivers_qsqlmysql_x86_64.so: dlopen failed: library "data_app~~eTc9EIgL6FFWDkaEV7AuPw==_org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==_base.apk!_lib_x86_64_libplugins_sqldrivers_qsqlmysql_x86_64.so" not found"
        W/qt.sql.qsqldatabase: QSqlDatabase: can not load requested driver 'QMYSQL', available drivers: QSQLITE QMARIADB QMYSQL
        I/default : main() returned -1
        D/VRI[QtActivity]: visibilityChanged oldVisibility=true newVisibility=false
        F/libc : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x71a943802ab8)
        F/libc : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x71a943802ab8)

        The plugin is in:

        /opt/qt-androidX86/plugins/sqldrivers/libplugins_sqldrivers_qsqlmysql_x86_64.so

        SMF-QtS 1 Reply Last reply
        0
        • SMF-QtS SMF-Qt

          @SMF-Qt

          The updated of my gradle from 8.12 to 8.14 got me a better response from the build process.
          I now sometimes end up on the break point I have set in my main (viewed as C++ not assembler) so the warning from Android Studio may have been a red herring..
          The problem is more likely to do with the mysql plugin in that I now get:

          (qputenv("QT_DEBUG_PLUGINS", QByteArray("1")); is the first line of code in my main())

          D/qt.core.plugin.factoryloader: Got keys from plugin meta data QList("android")
          D/qt.core.plugin.factoryloader: checking directory path "/data/app/~~eTc9EIgL6FFWDkaEV7AuPw==/org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==/base.apk!/lib/x86_64" ...
          D/qt.core.plugin.factoryloader: looking at "libplugins_sqldrivers_qsqlite_x86_64.so"
          D/qt.core.plugin.loader: Found metadata in lib /data/app/~~eTc9EIgL6FFWDkaEV7AuPw==/org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==/base.apk!/lib/x86_64/libplugins_sqldrivers_qsqlite_x86_64.so, metadata=
          D/qt.core.plugin.loader: {
          D/qt.core.plugin.loader: "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
          D/qt.core.plugin.loader: "MetaData": {
          D/qt.core.plugin.loader: "Keys": [
          D/qt.core.plugin.loader: "QSQLITE"
          D/qt.core.plugin.loader: ]
          D/qt.core.plugin.loader: },
          D/qt.core.plugin.loader: "archlevel": 2,
          D/qt.core.plugin.loader: "className": "QSQLiteDriverPlugin",
          D/qt.core.plugin.loader: "debug": true,
          D/qt.core.plugin.loader: "version": 395520
          D/qt.core.plugin.loader: }
          D/qt.core.plugin.loader:
          D/qt.core.plugin.loader:
          D/qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QSQLITE")
          D/qt.core.plugin.factoryloader: looking at "libplugins_sqldrivers_qsqlmysql_x86_64.so"
          D/qt.core.plugin.loader: Found metadata in lib /data/app/~~eTc9EIgL6FFWDkaEV7AuPw==/org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==/base.apk!/lib/x86_64/libplugins_sqldrivers_qsqlmysql_x86_64.so, metadata=
          D/qt.core.plugin.loader: {
          D/qt.core.plugin.loader: "IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
          D/qt.core.plugin.loader: "MetaData": {
          D/qt.core.plugin.loader: "Keys": [
          D/qt.core.plugin.loader: "QMYSQL",
          D/qt.core.plugin.loader: "QMARIADB"
          D/qt.core.plugin.loader: ]
          D/qt.core.plugin.loader: },
          D/qt.core.plugin.loader: "archlevel": 2,
          D/qt.core.plugin.loader: "className": "QMYSQLDriverPlugin",
          D/qt.core.plugin.loader: "debug": true,
          D/qt.core.plugin.loader: "version": 395520
          D/qt.core.plugin.loader: }
          D/qt.core.plugin.loader:
          D/qt.core.plugin.loader:
          D/qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QMYSQL", "QMARIADB")
          D/qt.core.library: "/data/app/~~eTc9EIgL6FFWDkaEV7AuPw==/org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==/base.apk!/lib/x86_64/libplugins_sqldrivers_qsqlmysql_x86_64.so" cannot load: Cannot load library /data/app/~~eTc9EIgL6FFWDkaEV7AuPw==/org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==/base.apk!/lib/x86_64/libplugins_sqldrivers_qsqlmysql_x86_64.so: dlopen failed: library "data_app~~eTc9EIgL6FFWDkaEV7AuPw==_org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==_base.apk!_lib_x86_64_libplugins_sqldrivers_qsqlmysql_x86_64.so" not found
          D/qt.core.plugin.loader: QLibraryPrivate::loadPlugin failed on "/data/app/~~eTc9EIgL6FFWDkaEV7AuPw==/org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==/base.apk!/lib/x86_64/libplugins_sqldrivers_qsqlmysql_x86_64.so" : "Cannot load library /data/app/~~eTc9EIgL6FFWDkaEV7AuPw==/org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==/base.apk!/lib/x86_64/libplugins_sqldrivers_qsqlmysql_x86_64.so: dlopen failed: library "data_app~~eTc9EIgL6FFWDkaEV7AuPw==_org.qtproject.example.QtTest2-nHnmjRvqqtO8_E_q7NVm-w==_base.apk!_lib_x86_64_libplugins_sqldrivers_qsqlmysql_x86_64.so" not found"
          W/qt.sql.qsqldatabase: QSqlDatabase: can not load requested driver 'QMYSQL', available drivers: QSQLITE QMARIADB QMYSQL
          I/default : main() returned -1
          D/VRI[QtActivity]: visibilityChanged oldVisibility=true newVisibility=false
          F/libc : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x71a943802ab8)
          F/libc : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x71a943802ab8)

          The plugin is in:

          /opt/qt-androidX86/plugins/sqldrivers/libplugins_sqldrivers_qsqlmysql_x86_64.so

          SMF-QtS Online
          SMF-QtS Online
          SMF-Qt
          wrote last edited by
          #4

          @SMF-Qt

          Unpacking the APK file shows that the libplugins_sqldrivers_qsqlmysql_x86_64.so is included:

          libcrypto_3.so
          libc++_shared.so
          libplugins_iconengines_qsvgicon_x86_64.so
          libplugins_imageformats_qgif_x86_64.so
          libplugins_imageformats_qicns_x86_64.so
          libplugins_imageformats_qico_x86_64.so
          libplugins_imageformats_qjpeg_x86_64.so
          libplugins_imageformats_qsvg_x86_64.so
          libplugins_imageformats_qtga_x86_64.so
          libplugins_imageformats_qtiff_x86_64.so
          libplugins_imageformats_qwbmp_x86_64.so
          libplugins_imageformats_qwebp_x86_64.so
          libplugins_networkinformation_qandroidnetworkinformation_x86_64.so
          libplugins_platforminputcontexts_qtvirtualkeyboardplugin_x86_64.so
          libplugins_platforms_qtforandroid_x86_64.so
          libplugins_qmltooling_qmldbg_debugger_x86_64.so
          libplugins_qmltooling_qmldbg_inspector_x86_64.so
          libplugins_qmltooling_qmldbg_local_x86_64.so
          libplugins_qmltooling_qmldbg_messages_x86_64.so
          libplugins_qmltooling_qmldbg_nativedebugger_x86_64.so
          libplugins_qmltooling_qmldbg_native_x86_64.so
          libplugins_qmltooling_qmldbg_preview_x86_64.so
          libplugins_qmltooling_qmldbg_profiler_x86_64.so
          libplugins_qmltooling_qmldbg_quick3dprofiler_x86_64.so
          libplugins_qmltooling_qmldbg_quickprofiler_x86_64.so
          libplugins_qmltooling_qmldbg_server_x86_64.so
          libplugins_qmltooling_qmldbg_tcp_x86_64.so
          libplugins_sqldrivers_qsqlite_x86_64.so
          libplugins_sqldrivers_qsqlmysql_x86_64.so
          libplugins_styles_qandroidstyle_x86_64.so
          libplugins_tls_qcertonlybackend_x86_64.so
          libplugins_tls_qopensslbackend_x86_64.so
          libQPlastiqueStyle_x86_64.so
          libQt6Concurrent_x86_64.so
          libQt6Core_x86_64.so
          libQt6Gui_x86_64.so
          libQt6Network_x86_64.so
          libQt6OpenGLWidgets_x86_64.so
          libQt6OpenGL_x86_64.so
          libQt6PrintSupport_x86_64.so
          libQt6QmlMeta_x86_64.so
          libQt6QmlModels_x86_64.so
          libQt6QmlWorkerScript_x86_64.so
          libQt6Qml_x86_64.so
          libQt6Quick3DUtils_x86_64.so
          libQt6Quick_x86_64.so
          libQt6Sql_x86_64.so
          libQt6Svg_x86_64.so
          libQt6VirtualKeyboard_x86_64.so
          libQt6Widgets_x86_64.so
          libQtTest2_x86_64.so
          libqwt_x86_64.so
          libssl_3.so
          libusb1.0.so
          libzstd.so

          SMF-QtS 1 Reply Last reply
          0
          • SMF-QtS SMF-Qt

            @SMF-Qt

            Unpacking the APK file shows that the libplugins_sqldrivers_qsqlmysql_x86_64.so is included:

            libcrypto_3.so
            libc++_shared.so
            libplugins_iconengines_qsvgicon_x86_64.so
            libplugins_imageformats_qgif_x86_64.so
            libplugins_imageformats_qicns_x86_64.so
            libplugins_imageformats_qico_x86_64.so
            libplugins_imageformats_qjpeg_x86_64.so
            libplugins_imageformats_qsvg_x86_64.so
            libplugins_imageformats_qtga_x86_64.so
            libplugins_imageformats_qtiff_x86_64.so
            libplugins_imageformats_qwbmp_x86_64.so
            libplugins_imageformats_qwebp_x86_64.so
            libplugins_networkinformation_qandroidnetworkinformation_x86_64.so
            libplugins_platforminputcontexts_qtvirtualkeyboardplugin_x86_64.so
            libplugins_platforms_qtforandroid_x86_64.so
            libplugins_qmltooling_qmldbg_debugger_x86_64.so
            libplugins_qmltooling_qmldbg_inspector_x86_64.so
            libplugins_qmltooling_qmldbg_local_x86_64.so
            libplugins_qmltooling_qmldbg_messages_x86_64.so
            libplugins_qmltooling_qmldbg_nativedebugger_x86_64.so
            libplugins_qmltooling_qmldbg_native_x86_64.so
            libplugins_qmltooling_qmldbg_preview_x86_64.so
            libplugins_qmltooling_qmldbg_profiler_x86_64.so
            libplugins_qmltooling_qmldbg_quick3dprofiler_x86_64.so
            libplugins_qmltooling_qmldbg_quickprofiler_x86_64.so
            libplugins_qmltooling_qmldbg_server_x86_64.so
            libplugins_qmltooling_qmldbg_tcp_x86_64.so
            libplugins_sqldrivers_qsqlite_x86_64.so
            libplugins_sqldrivers_qsqlmysql_x86_64.so
            libplugins_styles_qandroidstyle_x86_64.so
            libplugins_tls_qcertonlybackend_x86_64.so
            libplugins_tls_qopensslbackend_x86_64.so
            libQPlastiqueStyle_x86_64.so
            libQt6Concurrent_x86_64.so
            libQt6Core_x86_64.so
            libQt6Gui_x86_64.so
            libQt6Network_x86_64.so
            libQt6OpenGLWidgets_x86_64.so
            libQt6OpenGL_x86_64.so
            libQt6PrintSupport_x86_64.so
            libQt6QmlMeta_x86_64.so
            libQt6QmlModels_x86_64.so
            libQt6QmlWorkerScript_x86_64.so
            libQt6Qml_x86_64.so
            libQt6Quick3DUtils_x86_64.so
            libQt6Quick_x86_64.so
            libQt6Sql_x86_64.so
            libQt6Svg_x86_64.so
            libQt6VirtualKeyboard_x86_64.so
            libQt6Widgets_x86_64.so
            libQtTest2_x86_64.so
            libqwt_x86_64.so
            libssl_3.so
            libusb1.0.so
            libzstd.so

            SMF-QtS Online
            SMF-QtS Online
            SMF-Qt
            wrote last edited by SMF-Qt
            #5

            @SMF-Qt

            running:

            readelf --dynamic libplugins_sqldrivers_qsqlmysql_x86_64.so| grep NEEDED

            0x0000000000000001 (NEEDED) Shared library: [libmariadb.so]
            0x0000000000000001 (NEEDED) Shared library: [libQt6Sql_x86_64.so]
            0x0000000000000001 (NEEDED) Shared library: [libQt6Core_x86_64.so]
            0x0000000000000001 (NEEDED) Shared library: [liblog.so]
            0x0000000000000001 (NEEDED) Shared library: [libm.so]
            0x0000000000000001 (NEEDED) Shared library: [libc++_shared.so]
            0x0000000000000001 (NEEDED) Shared library: [libdl.so]
            0x0000000000000001 (NEEDED) Shared library: [libc.so]

            shows that the libmariadb.so (Mariadb connect library) has not been included in the APK.

            What is the correct way to include this dependency for a plugin in an android context ?

            SMF-QtS 1 Reply Last reply
            0
            • SMF-QtS SMF-Qt

              @SMF-Qt

              running:

              readelf --dynamic libplugins_sqldrivers_qsqlmysql_x86_64.so| grep NEEDED

              0x0000000000000001 (NEEDED) Shared library: [libmariadb.so]
              0x0000000000000001 (NEEDED) Shared library: [libQt6Sql_x86_64.so]
              0x0000000000000001 (NEEDED) Shared library: [libQt6Core_x86_64.so]
              0x0000000000000001 (NEEDED) Shared library: [liblog.so]
              0x0000000000000001 (NEEDED) Shared library: [libm.so]
              0x0000000000000001 (NEEDED) Shared library: [libc++_shared.so]
              0x0000000000000001 (NEEDED) Shared library: [libdl.so]
              0x0000000000000001 (NEEDED) Shared library: [libc.so]

              shows that the libmariadb.so (Mariadb connect library) has not been included in the APK.

              What is the correct way to include this dependency for a plugin in an android context ?

              SMF-QtS Online
              SMF-QtS Online
              SMF-Qt
              wrote last edited by SMF-Qt
              #6

              @SMF-Qt

              I linked my test app against the missing library and it got included in the APK (hack).

              Now on the many occasions that the debugger does not end up on my break point in main() the following output is noted:

              D/qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QMYSQL", "QMARIADB")
              D/qt.core.library: "/data/app/~~_QyhJ1cKweD6lRFr4k41Ew==/org.qtproject.example.QtTest2-ePOSiRm0FDBZIpSntSqqtQ==/base.apk!/lib/x86_64/libplugins_sqldrivers_qsqlmysql_x86_64.so" loaded library
              I/default : main() returned -1
              D/VRI[QtActivity]: visibilityChanged oldVisibility=true newVisibility=false
              F/libc : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x71a943802ab8)
              F/libc : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x71a943802ab8)
              F/libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 4670 (hwuiTask1), pid 4443 (example.QtTest2)
              F/crash_dump64: crash_dump.cpp:627] failed to attach to thread 4670, already traced by 4562 (/data/user/0/org.qtproject.example.QtTest2/lldb-server)
              F/libc : crash_dump helper failed to exec, or was killed
              19:31:41: Debugging of has finished.
              19:31:42: Android target "org.qtproject.example.QtTest2" died.

              SMF-QtS 1 Reply Last reply
              0
              • SMF-QtS SMF-Qt

                @SMF-Qt

                I linked my test app against the missing library and it got included in the APK (hack).

                Now on the many occasions that the debugger does not end up on my break point in main() the following output is noted:

                D/qt.core.plugin.factoryloader: Got keys from plugin meta data QList("QMYSQL", "QMARIADB")
                D/qt.core.library: "/data/app/~~_QyhJ1cKweD6lRFr4k41Ew==/org.qtproject.example.QtTest2-ePOSiRm0FDBZIpSntSqqtQ==/base.apk!/lib/x86_64/libplugins_sqldrivers_qsqlmysql_x86_64.so" loaded library
                I/default : main() returned -1
                D/VRI[QtActivity]: visibilityChanged oldVisibility=true newVisibility=false
                F/libc : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x71a943802ab8)
                F/libc : FORTIFY: pthread_mutex_lock called on a destroyed mutex (0x71a943802ab8)
                F/libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 4670 (hwuiTask1), pid 4443 (example.QtTest2)
                F/crash_dump64: crash_dump.cpp:627] failed to attach to thread 4670, already traced by 4562 (/data/user/0/org.qtproject.example.QtTest2/lldb-server)
                F/libc : crash_dump helper failed to exec, or was killed
                19:31:41: Debugging of has finished.
                19:31:42: Android target "org.qtproject.example.QtTest2" died.

                SMF-QtS Online
                SMF-QtS Online
                SMF-Qt
                wrote last edited by SMF-Qt
                #7

                @SMF-Qt

                To simplify things I have now written a simple app that pops a window and checks to see if it can open a mysql database on a remote server and writes a message on the state of the access.
                The build for this app is clean and it finds the mariadb.so without prompting which is progress.

                As a standard Linux build this works fine and reports that it has opened the database ok.

                On an android simulator build the window pops up and reports that it cannot open the database.

                I think the problem is with my mariadb connector plugin. Using wireshark I can see using the Linux test program:

                192.168.0.2 192.168.1.2 TCP 74 3306 → 59544 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM TSval=3571608572 TSecr=4174219190 WS=128
                192.168.1.2 192.168.0.2 TCP 66 59544 → 3306 [ACK] Seq=1 Ack=1 Win=64256 Len=0 TSval=4174219190 TSecr=3571608572
                192.168.0.2 192.168.1.2 MySQL 159 Server Greeting proto=10 version=10.6.12-MariaDB
                192.168.1.2 192.168.0.2 TCP 66 59544 → 3306 [ACK] Seq=1 Ack=94 Win=64256 Len=0 TSval=4174219191 TSecr=3571608573
                192.168.1.2 192.168.0.2 MySQL 266 Login Request user=root db=test
                192.168.0.2 192.168.1.2 TCP 66 3306 → 59544 [ACK] Seq=94 Ack=201 Win=65152 Len=0 TSval=3571608574 TSecr=4174219191
                192.168.0.2 192.168.1.2 MySQL 86 Response OK
                192.168.1.2 192.168.0.2 MySQL 88 Request Query
                192.168.0.2 192.168.1.2 MySQL 177 Response OK
                192.168.1.2 192.168.0.2 MySQL 75 Request Use Database
                192.168.0.2 192.168.1.2 MySQL 86 Response OK
                192.168.1.2 192.168.0.2 MySQL 83 Request Prepare Statement
                192.168.0.2 192.168.1.2 MySQL 188 Response
                192.168.1.2 192.168.0.2 MySQL 75 Request Close Statement
                192.168.1.2 192.168.0.2 MySQL 95 Request Prepare Statement
                192.168.0.2 192.168.1.2 TCP 66 3306 → 59544 [ACK] Seq=367 Ack=287 Win=65152 Len=0 TSval=3571608576 TSecr=4174219194
                192.168.0.2 192.168.1.2 MySQL 82 Response
                192.168.1.2 192.168.0.2 MySQL 75 Request Close Statement
                192.168.1.2 192.168.0.2 MySQL 177 Request Query
                192.168.0.2 192.168.1.2 TCP 66 3306 → 59544 [ACK] Seq=383 Ack=407 Win=65152 Len=0 TSval=3571608577 TSecr=4174219194
                192.168.0.2 192.168.1.2 MySQL 167 Response TABULAR Response
                192.168.1.2 192.168.0.2 MySQL 71 Request Quit
                192.168.1.2 192.168.0.2 TCP 66 59544 → 3306 [FIN, ACK] Seq=412 Ack=484 Win=64256 Len=0 TSval=4174219195 TSecr=3571608577
                192.168.0.2 192.168.1.2 TCP 66 3306 → 59544 [FIN, ACK] Seq=484 Ack=413 Win=65152 Len=0 TSval=3571608578 TSecr=4174219195
                192.168.1.2 192.168.0.2 TCP 66 59544 → 3306 [ACK] Seq=413 Ack=485 Win=64256 Len=0 TSval=4174219196 TSecr=3571608578

                Where the Android simulator version does:

                192.168.1.2 192.168.0.2 TCP 74 45974 → 3306 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM TSval=4173921792 TSecr=0 WS=128
                192.168.0.2 192.168.1.2 TCP 74 3306 → 45974 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM TSval=3571311174 TSecr=4173921792 WS=128
                192.168.1.2 192.168.0.2 TCP 66 45974 → 3306 [ACK] Seq=1 Ack=1 Win=64256 Len=0 TSval=4173921792 TSecr=3571311174
                192.168.0.2 192.168.1.2 MySQL 159 Server Greeting proto=10 version=10.6.12-MariaDB
                192.168.1.2 192.168.0.2 TCP 66 45974 → 3306 [ACK] Seq=1 Ack=94 Win=64256 Len=0 TSval=4173921793 TSecr=3571311175
                192.168.1.2 192.168.0.2 TCP 66 45974 → 3306 [FIN, ACK] Seq=1 Ack=94 Win=64256 Len=0 TSval=4173921793 TSecr=3571311175
                192.168.0.2 192.168.1.2 TCP 66 3306 → 45974 [FIN, ACK] Seq=94 Ack=2 Win=65280 Len=0 TSval=3571311176 TSecr=4173921793
                192.168.1.2 192.168.0.2 TCP 66 45974 → 3306 [ACK] Seq=2 Ack=95 Win=64256 Len=0 TSval=4173921794 TSecr=3571311176

                My mariadb connector plugin setup must be wrong still, even though everything from building qt 6.9.1 through to this new app appears to build clean.

                Any suggestions or input welcome.

                1 Reply Last reply
                0
                • SMF-QtS Online
                  SMF-QtS Online
                  SMF-Qt
                  wrote last edited by
                  #8

                  Just built an arm64-v8a version and manually installed the apk file on my Samsung A06 phone and it behaves just like the X86_64 simulator.

                  1 Reply Last reply
                  0
                  • cristian-adamC Online
                    cristian-adamC Online
                    cristian-adam
                    wrote last edited by
                    #9

                    Regarding the Android debugger, have you set settings set plugin.jit-loader.gdb.enable off in Preferences > Debugger > GDB > Additional Attach Commands! as mentioned at https://forum.qt.io/topic/162125/android-debugging-stopping-in-disassembly-in-qt-creator-your-1-is-needed/ ?

                    But it looks like you can debug in other ways, and it won't help that much.

                    SMF-QtS 1 Reply Last reply
                    1
                    • cristian-adamC cristian-adam

                      Regarding the Android debugger, have you set settings set plugin.jit-loader.gdb.enable off in Preferences > Debugger > GDB > Additional Attach Commands! as mentioned at https://forum.qt.io/topic/162125/android-debugging-stopping-in-disassembly-in-qt-creator-your-1-is-needed/ ?

                      But it looks like you can debug in other ways, and it won't help that much.

                      SMF-QtS Online
                      SMF-QtS Online
                      SMF-Qt
                      wrote last edited by
                      #10

                      @cristian-adam

                      Thank you that has helped a lot I can now debug down through the Qt MySql plugin and reach the mariadb code.
                      Hopefully I can figure out what is wrong now.

                      SMF-QtS 1 Reply Last reply
                      1
                      • SMF-QtS SMF-Qt

                        @cristian-adam

                        Thank you that has helped a lot I can now debug down through the Qt MySql plugin and reach the mariadb code.
                        Hopefully I can figure out what is wrong now.

                        SMF-QtS Online
                        SMF-QtS Online
                        SMF-Qt
                        wrote last edited by
                        #11

                        @SMF-Qt

                        It looks like mariadb-connect-c tries to connect to the designated mysql server using ssl but this is not the default for mysql (mariadb) hence the disconnect.
                        If mariadb-connect-c is build with:
                        -DDEFAULT_SSL_VERIFY_SERVER_CERT=0

                        This does not happen and the database can be opened.

                        I need to look into this more but for now I can continue with my android build testing.

                        1 Reply Last reply
                        0
                        • SMF-QtS Online
                          SMF-QtS Online
                          SMF-Qt
                          wrote last edited by
                          #12

                          My full blown test app now runs on the X86_64 simulator it looks awful its ui was not designed for phone use but all the bells gongs and whistles are there and information from my database is populating the widgets which is good.

                          Time now to reflect on what I have learned and tidy up loose ends, thanks to those who helped on this journey.

                          1 Reply Last reply
                          0
                          • SMF-QtS SMF-Qt referenced this topic
                          • SMF-QtS SMF-Qt has marked this topic as solved

                          • Login

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