Moritz Post
11/04/2022, 2:14 PMcommon
source folder. I have added kotlinx.serialization
and am using it successfully in the app. However in the AndroidStudio source editor all classes from the serialization library are marked as unresolved and no tooling works for them. Is anybody aware of such an issue?Adam Cooper
11/04/2022, 2:25 PMAdam Cooper
11/04/2022, 2:26 PMplugins {
kotlin("plugin.serialization") version "1.7.20"
}
Moritz Post
11/04/2022, 2:26 PMAdam Cooper
11/04/2022, 2:28 PMMoritz Post
11/04/2022, 2:28 PMAdam Cooper
11/04/2022, 2:28 PMeygraber
11/04/2022, 2:40 PMMoritz Post
11/04/2022, 2:44 PMMoritz Post
11/04/2022, 2:46 PMMoritz Post
11/04/2022, 2:50 PMeygraber
11/04/2022, 3:16 PM/**
* apply this hack for Android Studio because AGP and KGP aren't handling it correctly yet
*
* [Kotlin Slack](<https://kotlinlang.slack.com/archives/C3PQML5NU/p1652777328313809|https://kotlinlang.slack.com/archives/C3PQML5NU/p1652777328313809>)
*
* [Issue Tracker](<https://issuetracker.google.com/issues/231701341|https://issuetracker.google.com/issues/231701341>)
*/
public fun KotlinMultiplatformExtension.androidStudioHackForCommonMain() {
sourceSets.configureEach {
if(name == "androidMain") {
kotlin.srcDir("src/commonMain/kotlin")
}
}
}
Moritz Post
11/04/2022, 3:29 PMeygraber
11/04/2022, 3:30 PMkotlin
blockMoritz Post
11/04/2022, 3:41 PMMoritz Post
11/04/2022, 5:07 PMMoritz Post
11/04/2022, 5:09 PMayodele
11/05/2022, 6:13 AM