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')
...
}
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 ?
You can change the inside of the panel build variant.
The latest AS3.0 canary 8 fixed this issue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With