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

Wrong package name in build/run process when using build.gradle defaultConfig option

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 4.7.0-rc1
    • Android Support
    • None

    Description

      When using build.gradle file (for configure applicationId or version code) QtCreator can not build and run project. Thats happens because it using template AndroidManifest.xml file from project. But gradle in build step generate full AndroidManifest.xml file with real package name and version. Example defaultConfig for build.gradle file:

      android {
          defaultConfig {
              applicationId "com.bugqtcreator.gradle"
              minSdkVersion 16
              targetSdkVersion 27
              versionCode 100
              versionName "1.0.0"
              manifestPlaceholders = [
                  libName:"bugqtcreator"
              ]
          }
          /* Other setting */
      }
      

      QtCreator uses file: androidSourceDirectory+/AndroidManifest.xml
      But correct file location (after gradle generation steps): outputDirectory+build/intermediates/manifests/full/debug/AndroidManifest.xml

      My solution for androiddeployqt tool androiddeployqt github commit This workaround fix only build step. So QtCreator with that patched tool can build project (that using build.gradle defaultConfig option), but can not run it.

      Another same (but not so critical) problem when using defaultConfig in build.gradle file: minSdkVersion, versionName, versionCode are read from template AndroidManifest.xml too. Not from full manifest generated by gradle in build step.

      Attachments

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

        Activity

          People

            portale Alessandro Portale
            raymondo Roman Putintsev
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes