Philipp Smorygo [JB]
05/31/2022, 10:07 PMplugins {
kotlin("multiplatform")
id("com.android.application")
}
group = "me.user"
version = "1.0-SNAPSHOT"
kotlin {
android()
sourceSets {
val androidMain by getting {
dependencies {
val compose_version = "1.2.0-beta02"
implementation(project(":shared"))
implementation("androidx.core:core-ktx:1.7.0")
implementation("androidx.compose.ui:ui:$compose_version")
implementation("androidx.compose.runtime:runtime:$compose_version")
implementation("androidx.compose.ui:ui-tooling:$compose_version")
implementation("androidx.compose.foundation:foundation:$compose_version")
implementation("androidx.compose.ui:ui-tooling-preview:$compose_version")
implementation("androidx.compose.material:material:$compose_version")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.1")
implementation("androidx.activity:activity-compose:1.4.0")
implementation("com.google.android.material:material:1.5.0")
implementation("androidx.appcompat:appcompat:1.4.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
}
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
}
}
android {
compileSdkVersion(32)
defaultConfig {
applicationId = "me.user.androidApp"
minSdkVersion(24)
targetSdkVersion(32)
versionCode = 1
versionName = "1.0"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.2.0-beta02"
}
}
But the problem is that application fails to build with
Caused by: java.lang.IllegalStateException: couldn't find inline method Landroidx/compose/runtime/ComposablesKt;.remember(Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
at org.jetbrains.kotlin.codegen.inline.SourceCompilerForInlineKt.getMethodNode(SourceCompilerForInline.kt:118)
at org.jetbrains.kotlin.codegen.inline.SourceCompilerForInlineKt.loadCompiledInlineFunction(SourceCompilerForInline.kt:96)
at org.jetbrains.kotlin.backend.jvm.codegen.IrSourceCompilerForInline.compileInlineFunction(IrSourceCompilerForInline.kt:90)
at org.jetbrains.kotlin.codegen.inline.InlineCodegen.performInline(InlineCodegen.kt:47)
... 67 more
Kotlin is 1.6.21
AGP version 7.2.1
I have
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.2.0-beta02"
}
In my shared
module as well (edited)ephemient
06/01/2022, 1:06 AMephemient
06/01/2022, 1:07 AMephemient
06/01/2022, 1:08 AMPhilipp Smorygo [JB]
06/01/2022, 9:30 AM