```Incompatible because this component declares a ...
# multiplatform
a
Copy code
Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'
I am getting No matching variant when I try to add my KMM library to my android app via maven local repository. I have added
id("com.android.library")
at the top of plugin list and also added
Copy code
kotlin {
    android {
        publishLibraryVariants("release", "debug")
    }
}
I have also specified matching fall back for debug in my library's build.gradle
Copy code
buildTypes {
    getByName("release") {
        isMinifyEnabled = false
    }
    getByName("debug"){
        matchingFallbacks.add("release")
    }
}
Any help will be appreciated
r
matchingFallbacks need to be specified in the consuming app, not the library (but are only important if the app declares flavors or non-default build types)
a
we have
debug, qa, rc and release
build variants in the app so do I need to specify matchingfallbacks for all of them?
r
you might not need them for debug and release. You definitely need them for the others
👍 1
201 Views