Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't change modules buildVariant



I have a project with a main app and 3 modules. They depend on each other like

app (android application)
 |
 --- module1 (android library)
       |
       --- module2 (android library)
             |
             --- module3 (android library)         

I'm using AS 3.0 with BuildTool 3.0.0-alpha5.

I applied changes described in the doc: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#variant_dependencies


Here is my build.gradle (app)

apply plugin: 'com.android.application'
android {
    ...
    buildTypes {
        debug {}
        qa {}
        release {}
    }
    flavorDimensions "default"
    productFlavors {
        flavor1 {dimension = "default"}
        flavor2 {dimension = "default"}
    }
}
dependencies {
    ...
    implementation project(path: ':module1')
    ...
}

Here is my build.gradle (module1)

apply plugin: 'com.android.library'
android {
    ...
    buildTypes {
        debug {}
        qa {}
        release {}
    }
}
dependencies {
    ...
    implementation project(path: ':module2')
    ...
}

Here is my build.gradle (module2)

apply plugin: 'com.android.library'
android {
    ...
    buildTypes {
        debug {}
        qa {}
        release {}
    }
}
dependencies {
    ...
    implementation project(path: ':module3')
    ...
}




My problem: my app is set on "flavor1Debug" but all my modules variants are stuck on "qa". I can't switch them to "debug" in the BuildVariant window.

I have a Gradle Sync warning:

Warning:
Module 'module1' has variant 'debug' selected, but the module ''app'' depends on variant 'qa'
Select 'module1' in "Build Variants" window

Is anyone have an idea of what I missed ?

like image 212
Kyso84 Avatar asked Oct 17 '22 09:10

Kyso84


2 Answers

You can change the inside of the panel build variant.

enter code here

like image 157
Rasoul Miri Avatar answered Oct 21 '22 05:10

Rasoul Miri


The latest AS3.0 canary 8 fixed this issue

like image 44
Kyso84 Avatar answered Oct 21 '22 04:10

Kyso84