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. Cannot debug minimal App on Android

Cannot debug minimal App on Android

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 1.4k 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.
  • S Offline
    S Offline
    s.frings74
    wrote on last edited by
    #1

    Using Qt 5.2.1, Android SDK 22, Android API 19, Android NDK 9, working on 32bit Ubuntu 14.04.
    Tried with a real Android 4.1 phone and a virtual Android 4.4 phone.

    When I create a new Android App project, Qt Creator create a minimal example with an empty *.ui file for the main window. I can run and debug this application.

    But I do not want to use *.ui files. I want to create my widgets programmatically. When I do so, the debugger waits about one minute for something and then says "'org.qtproject.example.DebugTest' konnte nicht gestartet werden." (not able to start the application). But this is wrong, the application started on the mobile device.

    This is the whole program:
    @
    #include <QApplication>
    #include <QPushButton>
    #include <QVBoxLayout>

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);

    QWidget* window=new QWidget();
    QVBoxLayout* layout=new QVBoxLayout();
    window->setLayout(layout);
    QPushButton* button=new QPushButton("Hello");
    layout->addWidget(button);
    window->show();
    
    return app.exec();
    

    }
    @

    What am I doing wrong?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      stevenceuppens
      wrote on last edited by
      #2

      Your code looks ok,

      Did you use the same project template as with your ui files?

      Or did you start over in a new project?

      Steven CEUPPENS
      Developer &#x2F; Architect
      Mobile: +32 479 65 93 10

      1 Reply Last reply
      0
      • S Offline
        S Offline
        s.frings74
        wrote on last edited by
        #3

        Yes, I edited the auto-generated project. I just removed the mainwindow.ui, mainwindow.cpp and mainwindow.h file. So there is only the projectfile and main.cpp left. I did not edit the project file. Of course QT removed the three files automatically from it.

        Was that wrong?

        This is the project file:
        @
        TARGET = DebugTest
        TEMPLATE = app
        MOBILITY =
        QT += core gui widgets
        SOURCES += main.cpp
        HEADERS +=
        FORMS +=
        CONFIG += mobility
        ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
        OTHER_FILES +=
        @

        The problem occurs also when I reduce the program to the following:

        @
        int main(int argc, char *argv[])
        {
        QApplication app(argc, argv);
        return app.exec();
        }
        @

        1 Reply Last reply
        0
        • S Offline
          S Offline
          s.frings74
          wrote on last edited by
          #4

          Since today morning, the problem occurs on my mobile phone also with the unmodified template that Qt creator generates when I create a new Android Widget application. So it does not make any difference naymore, whether I use a *.ui file or not.

          Of course, I rebootet the phone several times and I started over with a new project. I cleaned all temp directories that I am aware of. No luck, I cannot debug applications on my phone anymore. The problem occurs always now.

          I borrowed another device (a Tablet with Android 4.1.2), same problem here.

          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