martmists
12/13/2022, 10:28 PMPablichjenkov
12/13/2022, 11:20 PMPablichjenkov
12/13/2022, 11:25 PMmartmists
12/13/2022, 11:56 PMCould not create an instance of type org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget.
> Could not generate a decorated class for type KotlinAndroidTarget.
> com/android/build/gradle/api/BaseVariantPablichjenkov
12/14/2022, 12:29 AMPablichjenkov
12/14/2022, 12:31 AMDavid Herman
03/05/2023, 5:44 PMgoogle() to your pluginManagement block, in your settings.gradle file (next to where gradlePluginPortal is declared)David Herman
03/05/2023, 6:07 PMandroid { ... } block with a compileSdk and namespace set.
2. Add the following line to my gradle.properties file: kotlin.mpp.androidSourceSetLayoutVersion=2 (I got a warning message suggesting it)
3. Configure the android target in the kotlin block to publish a release artifact (since in my project, I'm building a multiplatform library that can be consumed by Android):
kotlin {
android {
publishLibraryVariants("release")
}
}
4. Add an AndroidManifest.xml file under src/androidMain
Edit: Here's the final diff of the change I made, in case anyone wanted to reference it.