Kevin S
05/31/2023, 8:01 PMcom.vanniktech.maven.publish
, and I am running into errors when importing the library into a project. Publishing works fine, but once I add it to a project I get this error:
Execution failed for task ':sample:android:dataBindingMergeDependencyArtifactsDebug'.
> Could not resolve all files for configuration ':sample:android:debugRuntimeClasspath'.
> Could not resolve io.github.kevinschildhorn:atomik:0.0.3.
Required by:
project :sample:android > project :sample:common
> No matching variant of io.github.kevinschildhorn:atomik:0.0.3 was found. The consumer was configured to find a component for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.0.2', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- Variant 'iosArm64ApiElements-published' capability io.github.kevinschildhorn:atomik:0.0.3:
- Incompatible because this component declares a component for use during 'kotlin-api', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a component for use during runtime, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'
- Other compatible attributes:
- Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.0.2')
- Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'debug')
- Doesn't say anything about its target Java environment (preferred optimized for Android)
I saw a post about this being an issue in an earlier version and it suggested only doing a release version, but if I do that then I get some Unresolved Reference
errors when building, even though importing works fine in code.
Using:
classpath("com.android.tools.build:gradle:8.0.2")
classpath(kotlin("gradle-plugin", "1.8.10"))
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
CRamsan
05/31/2023, 8:02 PMKevin S
05/31/2023, 8:04 PMkotlin {
explicitApi()
android()
...
}
Jeff Lockhart
05/31/2023, 8:06 PMkotlin {
android {
publishAllLibraryVariants() // or
publishLibraryVariants("debug", "release")
}
...
}
Jeff Lockhart
05/31/2023, 8:08 PMKevin S
05/31/2023, 8:09 PMKevin S
05/31/2023, 9:11 PM