This message was deleted.
# community-support
s
This message was deleted.
h
t
yes, matching fallbacks is what you need here (I'm the author of the dependency analysis plugin)
s
Ah that makes a lot of sense, I wasn't aware of that feature. Thank you both! And thank you for the awesome plugin Tony, I'm learning so much about how I'm structuring my modules. Even turned a couple of them to JVM only after some encouragement from you on Twitter and this plugin helping me understand when I am safely able to do so! I know this is out of the scope of the original question, but if anyone happens to know, I would optimally not even want my Android library modules to have a release or a debug variant, like even now I don't know if it's make a difference to set matchingFallbacks to debug or release. For those modules there's no difference between the two, only for my app module. So can I do that somehow? And if not, what would actually be the difference if I set the matching fallbacks to release instead?
t
your android library modules must have at least one variant - that's just how AGP works. One of those types is always created by default (I forget which). You can find out by removing the build types block from one of your modules and then seeing what tasks are available on it
s
Hmm just tried it and it seems like both debug and release types are generated by default. With a minimal build.gradle.kts file like this
Copy code
plugins {
  alias(libs.plugins.androidLibrary)
  alias(libs.plugins.kotlin)
}

android {
  defaultConfig {
    minSdk = 23
    compileSdk = 33
    targetSdk = 33
  }
  compileOptions {
    sourceCompatibility = JavaVersion.VERSION_11
    targetCompatibility = JavaVersion.VERSION_11
  }
  kotlinOptions {
    jvmTarget = JavaVersion.VERSION_11.toString()
  }
}
I get both
compileDebugSources
and
compileReleaseSources
and so on. That’s quite odd imo, I don’t see how most libraries need to have more than one buildType, must be missing smth. Now just need to check if I can opt out of that or just accept that I’ll have both of them 🤷‍♂️
t
I guess it's possible that has changed since I last checked 🤔 You can disable variants with a variant filter
h
@Stylianos Gakis android libraries have debug and release buildTypes which is useful for most developers. The debug buildType will have have debug tools enabled to add breakpoints etc with a perf penalty, and can use a locally generated signing key. The release buildType is meant for consumer with minimum size footprint and best perf. As Tony said you can use a variantFilter to ignore variants.