Jetpack Compose crash NoSuchMethod in Composer or super class

Viewed 1324

I just updated Jetpack Compose (as well as kotlinCompilerExtensionVersion) to 1.0.0-beta07 and immediately started receiving this crash on app start. Downgrading removes the crash.

java.lang.NoSuchMethodError: No interface method startReplaceableGroup(ILjava/lang/String;)V in class Landroidx/compose/runtime/Composer; or its super classes (declaration of 'androidx.compose.runtime.Composer' appears in /data/app/~~VFlRsIkoEwB2qQlR7w1oWw==/*app.name*-itKCOLTh4XCfwxxLqBwHkg==/base.apk)

1 Answers

I solved the problem by updating Compose dependencies to 1.0.4

And also added in build.gradle (Module: app) under dependencies {...}

    tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
        kotlinOptions {
            // Treat all Kotlin warnings as errors
            // allWarningsAsErrors = true
            freeCompilerArgs += '-Xopt-in=kotlin.RequiresOptIn'
            // Enable experimental coroutines APIs, including Flow
            freeCompilerArgs += '-Xopt-in=kotlin.Experimental'
            freeCompilerArgs += '-Xallow-jvm-ir-dependencies'
    
            // Set JVM target to 1.8
            jvmTarget = "1.8"
        }
    }
Related