Tyler Turnbull
07/14/2024, 5:54 PMimplementation (project(":shared"))
then the android app builds just fine.
Error message is this:
Could not determine the dependencies of task ':udisc:compileFreeInternalTestDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':udisc:freeInternalTestDebugCompileClasspath'.
> Could not resolve project :shared.
Required by:
project :udisc
> No matching variant of project :shared was found. The consumer was configured to find a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.5.0', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'internalTestDebug', attribute 'com.android.build.api.attributes.ProductFlavor:versionCode' with value 'free', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
Any suggestions?mbonnin
07/14/2024, 6:17 PMmbonnin
07/14/2024, 6:18 PMshared
is missing androidTarget()
or using other settings but it’s hard to tellTyler Turnbull
07/14/2024, 6:36 PMplugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.android.library)
// alias(libs.plugins.kotlin.serialization)
}
kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "17"
}
}
}
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "shared"
isStatic = true
}
}
sourceSets {
commonMain.dependencies {
// implementation(libs.ktor.client.core)
// implementation(libs.ktor.serialization)
// implementation(libs.kotlinx.coroutines.core)
// implementation(libs.kotlinx.datetime)
}
androidMain.dependencies {
// implementation(libs.ktor.client.okhttp)
// implementation(libs.ktor.negotiation)
// implementation(libs.ktor.json)
// implementation(libs.okhttp.logging)
}
iosMain.dependencies {
// implementation(libs.ktor.client.darwin)
}
}
}
android {
namespace = "com.udisc.shared"
compileSdk = 34
defaultConfig {
minSdk = 28
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
Tyler Turnbull
07/14/2024, 6:38 PMmbonnin
07/14/2024, 7:27 PMIncompatible 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 'internalTestDebug'
mbonnin
07/14/2024, 7:27 PMmbonnin
07/14/2024, 7:27 PMTyler Turnbull
07/15/2024, 12:29 AM