Piotr Prus
09/04/2023, 8:38 PMshared
module, but keep getting unresolved reference
. I am on kotlin 1.9.0. The errors I am getting are :
e: .../shared/build.gradle.kts:11:5: Unresolved reference: androidTarget
e: .../shared/build.gradle.kts:23:5: Unresolved reference: targetHierarchy
e: .../shared/build.gradle.kts:24:9: Unresolved reference: common
I tried clear project and invalidate caches few times. the file in 🧵 👇Piotr Prus
09/04/2023, 8:39 PMplugins {
kotlin("multiplatform")
id("com.android.library")
id("co.touchlab.faktory.kmmbridge") version "0.3.7"
id("maven-publish")
}
version = "1.0"
kotlin {
androidTarget()
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "shared"
isStatic = true
}
}
targetHierarchy.default {
common {
group("mobile") {
withIos()
withAndroidTarget()
}
}
}
sourceSets {
val commonMain by getting {
dependencies {
//put your multiplatform dependencies here
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
}
}
android {
namespace = "retrolabs.retroapp.shared"
compileSdk = ConfigurationData.compileSdk
defaultConfig {
minSdk = ConfigurationData.minSdk
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
kmmbridge {
frameworkName.set("shared")
mavenPublishArtifacts()
githubReleaseVersions()
spm()
versionPrefix.set("0.3")
}
ayodele
09/04/2023, 8:48 PMPiotr Prus
09/04/2023, 9:06 PMPiotr Prus
09/05/2023, 10:19 AMkmmBridge
is messing up with the multiplatform kotlin 1.9.0, at least on my machine. Without that plugin everything is back to normal.kpgalligan
12/07/2023, 3:39 PM0.5.1
). We reference the KMP Gradle plugin in KMMBridge, but it was an implementaiton
dependency. Now compileOnly
. However, if your project is based on KMMBridge 0.3.x
, just be aware that KMMBridge 0.5.x
is fairly different. A lot of the logic around versioning was moved to CI.