Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-108834

QCoreApplication crashes when standalone application is used on Android

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.4.1
    • Core: Other
    • None
    • Android
    • 2023wkXXFOQtforAndroid

    Description

      Segmentation fault error is returned on android phone using C++ standalone application when the QCoreApplication is initialized. I did changes under src/corelib/kernel/qjnienvironment.cpp and src/corelib/kernel/qjniobject.cpp files where I fixed some unchecked pointers. These fixes solved the problem and my application no more crashes. The problem appeared because the JVM is not initialized when the Qt android is used with standalone application. I provide the modified files but I am not sure that this will be the proper solution because without JVM some functionalities will be lost. Maybe needed an additional build configuration for android without JVM?

      Hopefully you will provide a proper fix for this problem, in the worst case please use my fixes. Until this problem will be clarified on your side I will use my shared patches in my project.

      Qt base is built with the following cmake configuration:

      • -DQT_HOST_PATH=/* Host build of the qt base */
      • -DFEATURE_backtrace=OFF
      • -DANDROID_PLATFORM=android-30
      • -DANDROID_ABI=arm64-v8a
      • -DCMAKE_INSTALL_PREFIX=/* Install dir */
      • -DQT_QMAKE_TARGET_MKSPEC=android-clang
      • -DANDROID_SDK_ROOT=/* Android SDK */
      • -DANDROID_NDK_ROOT=/* Android NDK */
      • -DQT_BUILD_EXAMPLES=FALSE
      • -DQT_BUILD_TESTS=FALSE
      • -G 'Ninja'

      Attachments

        1. qjnienvironment.cpp
          16 kB
        2. qjniobject.cpp
          50 kB

        Issue Links

          Activity

            People

              assam Assam Boudjelthia
              dixon262 Csongor Nagy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: