rsetkus
11/12/2020, 4:06 PMCould not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not resolve xx.yy.mpp:kommon-android:0.0.1.
Required by:
project :app
> No matching variant of xx.yy.mpp:kommon-android:0.0.1 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 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- Variant 'android-releaseApiElements' capability xx.yy.mpp:kommon-android:0.0.1 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 'debug'
- Variant 'android-releaseRuntimeElements' capability xx.yy.mpp:kommon-android:0.0.1 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 'debug'
- Variant 'metadata-api' capability xx.yy.mpp:kommon-android:0.0.1:
- 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 'debug')
- Variant 'metadata-commonMainMetadataElements' capability xx.yy.mpp:kommon-android:0.0.1:
- 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 'debug')
Feeling it is more maven-publish
plugin issue but since it is KMP project I thought somebody else has faced with the same issue.Big Chungus
11/12/2020, 4:30 PMrsetkus
11/12/2020, 4:33 PMpublishToMavenLocal
gradle task. Target platform:
kotlin {
android {
publishAllLibraryVariants()
}
ios {
binaries {
framework {
baseName = "XXX"
}
}
}
...
Benjamin Charais
11/12/2020, 6:22 PMbuild/outputs/aar
but no publishable is generated, I am working on generating a manual publish, but am concerned I will not properly tie in with the metadata generated for publishing
This seems to be an issue with Kotlin 1.4, and 1.4.10, as the project I am working on works great on the previous versions before 1.4, and is not working as expected on upgrade.Benjamin Charais
11/12/2020, 6:27 PMpublishLibraryVariants = listOf("release", "debug")
which errors out with the snippet.rsetkus
11/12/2020, 6:56 PMid("com.android.library")
before multiplatform plugin declaration?
Also, do get the same error when you try to build Android app with dependency of published multiplatform library on local maven?Benjamin Charais
11/12/2020, 7:24 PMcom.android.library
for our android declaration.
I do get the same error you described.rsetkus
11/12/2020, 8:23 PMmatchingFallbacks
versions in your app’s build script. If your app is including Multiplatform release version, then it should look like this.
android {
buildTypes {
debug {
matchingFallbacks = ['release']
}
}
}
Benjamin Charais
11/12/2020, 8:25 PMrsetkus
11/12/2020, 8:30 PMrsetkus
11/12/2020, 8:44 PMBenjamin Charais
11/12/2020, 8:47 PMBenjamin Charais
11/12/2020, 8:50 PMpublishLibraryVariantsGroupedByFlavor = true
might be helpfulrsetkus
11/12/2020, 8:55 PMBenjamin Charais
11/12/2020, 8:59 PMrsetkus
11/12/2020, 9:07 PM