Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-27528

Android integration is broken in multiple places

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • Qt Creator 7.0.1
    • Android Support
    • None

    Description

      I've tried to set up an android development environment. This is what I'm struggling with:

      • The auto-download of the android command line tools puts them in ~/Android/Sdk/cmdline-tools/{bin|lib|...}. Trying to run one of the tools from there from a terminal results in an error as they expect to be in ~/Android/Sdk/cmdline-tools/latest/{bin|lib|...}. This is easily fixed by actually moving them there and symlinking back to the place Qt Creator expects.
      • The SDK package installation failed the first time around. I may have experienced an intermittent network failure. The download bar froze and the only way to fix it was to restart Qt Creator. The second try worked.
      • I had to restart Qt Creator in order for the changes in the Devices->Android settings to be propagated to the Devices->Devices settings. The android option didn't show up in the "Add..." dialog before.
      • Creating an AVD with my new SDK packages seemingly worked. The device showed up in the "Device" dropdown. However, trying to build and run a sample application revealed that it didn't. I get the following error message in an error popup:
        ERROR   | Unknown AVD name [androidemu], use -list-avds to see valid list.
        ERROR   | HOME is defined but there is no file androidemu.ini in $HOME/.android/avd
        ERROR   | (Note: Directories are searched in the order $ANDROID_AVD_HOME, $ANDROID_SDK_HOME/avd and $HOME/.android/avd)
        INFO    | Android emulator version 31.2.10.0 (build_id 8420304) (CL:N/A)
        
      • Deleting the failed AVD doesn't work either. Pressing "Erase AVD" in the device settings, I get:
        An error occurred while removing the Android AVD "androidemu" using avdmanager tool.
        
      • The avdmanager command line tool confirms that the AVD does not exist.
      • So I use the Android Studio GUI to create an AVD. This causes the broken AVD to disappear in Qt Creator, and the new one to appear. I can start that AVD and the emulator is displayed.
      • I create a sample Qt Quick project in Qt Creator using the wizard, with CMake and Qt 6.2+. I configure it for the kit the AVD is assigned to, build, run. The emulator does not show anything. In Application Output I get:
        Activity Manager threw the error: Error type 3
        Error: Activity class {org.qtproject.example.appuntitled/org.qtproject.qt.android.bindings.QtActivity} does not exist.
        
      • I press the "Install an APK file" button in the deploy settings, navigate to the place where the build put the .apk file, and choose that. Nothing happens.
      • If I have Qt Creator auto-start the emulator when trying to run the application, the status indicator in the target selector never becomes green. It stays yellow. If I pre-start the emulator, it becomes green.
      • I get the same error if I create a Qt 5.15-based project with qmake build system.
      • Manually installing the APK the build process created using "adb install path/to.apk" works while the emulator is running. Starting the application from Qt Creator afterwards does something.
      • I put qDebug() statements in various places of my main() function and re-install using adb. Starting the application again causes some visual commotion on the emulator, but none of the debug messages show up in the Application Output pane.
      • Running "adb logcat" in a separate terminal produces the debug messages there.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              portale Alessandro Portale
              ulherman Ulf Hermann
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes