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. The android application made by Qt 5.7 has crashed down on only Lollipop (API level 21).
Forum Updated to NodeBB v4.3 + New Features

The android application made by Qt 5.7 has crashed down on only Lollipop (API level 21).

Scheduled Pinned Locked Moved Solved Mobile and Embedded
4 Posts 2 Posters 1.9k 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.
  • Douglas YooD Offline
    Douglas YooD Offline
    Douglas Yoo
    wrote on last edited by
    #1

    I’m new at Qt but I’m a professional developer for android.
    I’m testing the latest Qt version 5.7 for developing android apps.
    I had created a new project with default options in Qt Creator and just built the project without adding any code.
    After building, I ran the application on my desktop and it worked well on my desktop.
    I changed the build option to “Android for armeabi-v7a (GCC 4.9, Qt 5.7.0)” in order to build android app binary.
    After building the android binary, Qt Creator pushed the binary into my android device and let it run.
    It worked as well.
    However, when exiting the application by pushing “back” button on my android device, the application was always crashed down with a message “Unfortunately, xxxx has stopped.” and the Application Output window of Qt Creator showed me a message below as well.

    F/libc (19161): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 19395 (QtThread)

    I didn’t understand why the application had been crashed down.
    So, I investigated the problem on a lot of android device and I realized that the error occurred on only Lollipop android (Android API level 21).
    The application worked well on other android such as Jellybean and Kitkat other than Lollipop.

    Any help on this issue would be great for me.

    Thanks,
    Doug

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mvuori
      wrote on last edited by
      #2

      There may be just some bug in Lollipop -- but I think Marshmallow too has had some problems in exiting the application using the back button. That's why my app tries to make the handling managed, by capturing the back button and "manually" calling some cleanup code and then the application object's quit():

      bool MainWindow::eventFilter(QObject *obj, QEvent *event)
      {
          if (event->type() == QEvent::KeyPress) {
              QKeyEvent* key = static_cast<QKeyEvent*>(event);
              if (key->key() == Qt::Key_Back) {
                  MyApp->quit();
                  return true;
              }
          }
          return QObject::eventFilter(obj, event); 
      }
      
      Douglas YooD 1 Reply Last reply
      0
      • M mvuori

        There may be just some bug in Lollipop -- but I think Marshmallow too has had some problems in exiting the application using the back button. That's why my app tries to make the handling managed, by capturing the back button and "manually" calling some cleanup code and then the application object's quit():

        bool MainWindow::eventFilter(QObject *obj, QEvent *event)
        {
            if (event->type() == QEvent::KeyPress) {
                QKeyEvent* key = static_cast<QKeyEvent*>(event);
                if (key->key() == Qt::Key_Back) {
                    MyApp->quit();
                    return true;
                }
            }
            return QObject::eventFilter(obj, event); 
        }
        
        Douglas YooD Offline
        Douglas YooD Offline
        Douglas Yoo
        wrote on last edited by Douglas Yoo
        #3

        @mvuori

        I greatly appreciate your help.
        I had tried to add your code in my app and ran the app after building.
        However, the app was crashed down this time as well when exiting the app.
        The error was the same as before.
        I investigated this error further.

        By calling MyApp->quit(), The exec(); call of an application object in main() is returned well.
        But, the app is crashed down after returning main() with a error “Unfortunately, xxxx has stopped.”.

        the Application Output window of Qt Creator showed me a message below as well.

        F/libc (19161): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 19395 (QtThread)

        I think this is not the problem from “back” key.

        1 Reply Last reply
        0
        • Douglas YooD Offline
          Douglas YooD Offline
          Douglas Yoo
          wrote on last edited by
          #4

          I found the root cause of this issue.

          https://bugreports.qt.io/browse/QTBUG-52949

          It was a bug of Lollipop 5.0.
          The bug was first fixed in version 5.1.1_r1.

          https://code.google.com/p/android/issues/detail?id=160824

          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