2

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)

jacoballenwood
  • 2,787
  • 2
  • 24
  • 39
  • 2
    Have a look at https://stackoverflow.com/questions/67611497/java-lang-nosuchmethoderror-after-upgrading-jetpack-compose-to-1-0-0-beta07. The key is to update all libraries that depend on compose. In my case the error was caused by an outdated hilt_compose_navigation version – jns May 23 '21 at 12:16
  • Post your dependencies – Gabriele Mariotti May 23 '21 at 13:16
  • Thank you @jns! That was helpful. In my case, it was related to jetpack compose navigation dependency – jacoballenwood May 27 '21 at 11:50

1 Answers1

0

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"
        }
    }