Sonarqube Scanner for Android doesn't run against the applicationVariant

Template for a good bug report, formatted with Markdown:

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
    Scanner 3.0, Gradle 6.6.1

  • error observed (wrap logs/code around triple quote ``` for proper formatting)
    Gradle compiles the wrong variant when you ask for a sonarqube run; sonarqube scanner appears to be grabbing the first debug variant

  • steps to reproduce
    ./gradlew sonarqube --dry-run | grep app
    Runs a different flavor compile instead of running the one specified in applicationVariant
    Can’t figure out how to get you a repro project w/o sending you our entire project.

  • potential workaround
    None…tried applying the plugin against all subprojects instead, but it didn’t work