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

Qt Creator tries to start wrong Android application ID

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 9.0.1
    • Android Support
    • None
    • Android

    Description

      On Android, there are 2 places to specify the application package:

      • build.gradle - defines the unique package ID of the APK
      • AndroidManifest.xml - defines the "base" package name for relative class names in the manifest, e.g. for specifying <activity android:name=".MainActivity />

      These two are not necessarily the same.

      When installing and running the app, Qt Creator tries to start the app by the ID defined in manifest. 

      Instead, it should use the one from build.gradle.

      When changing the ID in build.gradle but not in Manifest (because you probably won't move all your Java sources), build & run fails:

      Activity Manager threw the error: Error type 3
      Error: Activity class {custom.android.packagename/org.qtproject.qt.android.bindings.QtActivity} does not exist.

      (because the wrong app ID is used).

      Test project attached. Build and Run with Qt 6.4.1 Android fails.

      Since the applicationId in build.gradle can be dynamic (e.g. set via gradle.properties), I would suggest checking the built APK file for the application ID and using that one.

      Attachments

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

        Activity

          People

            portale Alessandro Portale
            chrisub Christian Bartsch
            Votes:
            8 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes