This repository has been archived by the owner on Jan 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1k
mpp-iOS-Android: Unresolved reference: android #97
Comments
Same problem here. Android packages are not available in the android specific part. But in the ios specific part I can use e.g. the Foundation import. |
Could you please update this example? You are making a big investment into KMP, but the introductory example is almost 1 year old and it doesn't show how to reference android code. For those who end up here looking for a solution, this tutorial helped me Here are the relevant parts of my build.gradle.kts plugins {
id("com.android.library")
kotlin("multiplatform")
}
android {
compileSdkVersion(Versions.Android.compileSdk)
defaultConfig {
minSdkVersion(Versions.Android.minSdk)
targetSdkVersion(Versions.Android.targetSdk)
}
sourceSets {
getByName("main") {
manifest.srcFile("src/androidMain/AndroidManifest.xml")
java.srcDirs("src/androidMain/kotlin")
}
}
}
group = "com.kolibree"
version = "1.0-SNAPSHOT"
kotlin {
android()
[...] |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When I just write as
actual fun platformName(): String { return "Android " + android.os.Build.VERSION.BASE_OS }
in SharedCode/src/androidMain/kotlin/actual.kt I get: Unresolved reference: android
so it's mean that android platform module don't support android sdk :(
The text was updated successfully, but these errors were encountered: