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

QtCreator allows only to start Activity based applications

    XMLWordPrintable

Details

    Description

      Synopsis
      Qt Creator android plugin is using adb to start remote process on android device/emulator. To do so it invokes following sequence(AndroidRunnerWorker::asyncStartHelper())

      adb shell am start <extra_args> <intent_name>
      

      In case of sample project(attached) where there is no activity, but only service the sequence shall be:

      adb shell am startservice <extra_args> <intent_name>
      

      Otherwise the only thing that user sees is in Qt Creator is:

      
      Exception occurred while executing:
      java.lang.IllegalArgumentException: Bad component name: org.qtproject.example.service/
      	at android.content.Intent.parseCommandArgs(Intent.java:7254)
      	at com.android.server.am.ActivityManagerShellCommand.makeIntent(ActivityManagerShellCommand.java:317)
      	at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:409)
      	at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:172)
      	at android.os.ShellCommand.exec(ShellCommand.java:104)
      	at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:9766)
      	at android.os.Binder.shellCommand(Binder.java:881)
      	at android.os.Binder.onTransact(Binder.java:765)
      	at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:4500)
      	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2738)
      	at android.os.Binder.execTransactInternal(Binder.java:1021)
      	at android.os.Binder.execTransact(Binder.java:994)
      Failed to start the activity.
      
      
      "org.qtproject.example.service" died.
      
      

      Workaround
      Use adb console directly

      Expected behavior
      Android run settings widget allows to select whether target application is activity (default) or service based intent.

      Attachments

        1. SampleService.7z
          55 kB
          Przemyslaw Nogaj
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtandroidteam Qt Android Team
            przemyslawnogaj Przemyslaw Nogaj
            Miao Luo Miao Luo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes