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. Android Gradle build specific productFlavor
Forum Updated to NodeBB v4.3 + New Features

Android Gradle build specific productFlavor

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 1 Posters 281 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    Dylan White
    wrote on last edited by Dylan White
    #1

    We call qmake.exe and androiddeployqt.exe from the command line when building our app for Android.

    Our Gradle file contains something like:

    flavorDimensions "product"
    
    productFlavors {
        product1 {
            dimension "product"
            ....
        }
        product2 {
            dimension "product"
            ....
        }
    }
    

    The result is that both productFlavors (i.e. Product1Release, Product2Release) are built when running the script. Is there any way to specify to only build one of the productFlavors? (e.g. Product1Release)

    Many thanks

    D 1 Reply Last reply
    0
    • D Dylan White

      We call qmake.exe and androiddeployqt.exe from the command line when building our app for Android.

      Our Gradle file contains something like:

      flavorDimensions "product"
      
      productFlavors {
          product1 {
              dimension "product"
              ....
          }
          product2 {
              dimension "product"
              ....
          }
      }
      

      The result is that both productFlavors (i.e. Product1Release, Product2Release) are built when running the script. Is there any way to specify to only build one of the productFlavors? (e.g. Product1Release)

      Many thanks

      D Offline
      D Offline
      Dylan White
      wrote on last edited by
      #2

      @Dylan-White Looking at the source for androiddeployqt it looks like it will only ever build debug or release builds. See the following

      QString commandLine = QString::fromLatin1("%1 --no-daemon %2").arg(shellQuote(gradlePath)).arg(options.releasePackage ? QLatin1String(" assembleRelease") : QLatin1String(" assembleDebug"));
      if (options.verbose)
          commandLine += QLatin1String(" --info");
      
      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