LouisCAD / Splitties

A collection of hand-crafted extensions for your Kotlin projects.

Home Page:https://splitties.louiscad.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot compile with custom buildType

axrkozlov opened this issue · comments

Hi!
I have buildType named 'dev' and can't compile my project with splitters library com.louiscad.splitties:splitties-fun-pack-android-base:3.0.0-beta01.

StackTrace:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDev'.

Could not resolve all files for configuration ':app:devCompileClasspath'.
Could not resolve com.louiscad.splitties:splitties-fun-pack-android-base:3.0.0-beta01.
Required by:
project :app
> No matching variant of com.louiscad.splitties:splitties-fun-pack-android-base:3.0.0-beta01 was found. The consumer was configured to find an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'dev', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- Variant 'android-debugApiElements' capability com.louiscad.splitties:splitties-fun-pack-android-base:3.0.0-beta01 declares an API of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'dev'
- Variant 'android-debugRuntimeElements' capability com.louiscad.splitties:splitties-fun-pack-android-base:3.0.0-beta01 declares a runtime of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'dev'
- Variant 'android-releaseApiElements' capability com.louiscad.splitties:splitties-fun-pack-android-base:3.0.0-beta01 declares an API of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
- 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 'dev'
- Variant 'android-releaseRuntimeElements' capability com.louiscad.splitties:splitties-fun-pack-android-base:3.0.0-beta01 declares a runtime of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
- 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 'dev'
- Variant 'metadata-api' capability com.louiscad.splitties:splitties-fun-pack-android-base:3.0.0-beta01:
- Incompatible because this component declares a usage of 'kotlin-metadata' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed an API of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'
- Other compatible attribute:
- Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'dev')
- Variant 'metadata-commonMainMetadataElements' capability com.louiscad.splitties:splitties-fun-pack-android-base:3.0.0-beta01:
- Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed an API of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'
- Other compatible attribute:
- Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'dev')

With debug and release types the project is compiling.

Hi, you need to use matchingFallbacks.

@LouisCAD Thank's a lot! I was really puzzled by the error messages. Thank's for this hint!

In case anyone else finds this issue, here is the actual documentation:
https://developer.android.com/studio/build/dependencies#variant_aware