I’m trying to organize the project with kotlin multi-platform mobile, but there’s a problem.
However, the shared module displays a warning message “Kotlin not configured” in the commonMain’s kotlin file.
Where did it go wrong?
Build.gradle.kts
plugins {
//trick: for the same plugin versions in all sub-modules
alias(libs.plugins.androidApplication).apply(false)
alias(libs.plugins.androidLibrary).apply(false)
alias(libs.plugins.kotlinAndroid).apply(false)
alias(libs.plugins.kotlinMultiplatform).apply(false)
alias(libs.plugins.kotlinCocoapods).apply(false)
}
Shared build.gradle.kts
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.kotlinCocoapods)
alias(libs.plugins.androidLibrary)
}
kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
iosX64()
iosArm64()
iosSimulatorArm64()
cocoapods {
summary = "Some description for the Shared Module"
homepage = "Link to the Shared Module homepage"
version = "1.0"
ios.deploymentTarget = "16.0"
podfile = project.file("../iosApp/Podfile")
framework {
baseName = "shared"
isStatic = true
}
}
sourceSets {
commonMain.dependencies {
}
commonTest.dependencies {
implementation(libs.kotlin.test)
}
}
}
android {
namespace = "com.devjeong.watermelon_player"
compileSdk = 34
defaultConfig {
minSdk = 24
}
}
dependencies {
implementation("androidx.core:core-ktx:+")
}
shared.src.commonMain.Platform.kt
- Android Studio Version = Giraffe 2022.3.1 patch 4
- gradle version = 8.1.3
- Kotlin version = 1.9.20