Android jetpack compose NoSuchMethodError: No static method setContent


Jetpack Compose release version: 1.0.0-alpha06
Android Studio Build:
4.2 1Canery 15

my Activity

class MainActivityA : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        setContent {
              Text(text = "hello", modifier = Modifier.padding(12.dp))


THe above when run compiles this error:

java.lang.NoSuchMethodError: No static method setContent$default(Landroidx/activity/ComponentActivity;Landroidx/compose/runtime/Recomposer;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Landroidx/compose/runtime/Composition; in class Landroidx/compose/ui/platform/WrapperKt; or its super classes (declaration of 'androidx.compose.ui.platform.WrapperKt' appears in /data/app/com.jonathan-_j03c44RbBo00Hn7DeOjeA==/base.apk)

some of my gradle settings

def jetpack_compose = "1.0.0-alpha06"

 kotlinOptions {
        jvmTarget = '1.8'
        useIR = true

    composeOptions {
        kotlinCompilerVersion '1.4.0'
        kotlinCompilerExtensionVersion "$jetpack_compose"

  //JetPack Compose stuff
    implementation "androidx.compose.ui:ui:$jetpack_compose"
    // Tooling support (Previews, etc.)
    implementation "androidx.ui:ui-tooling:$jetpack_compose"
    // Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.)
    implementation "$jetpack_compose"
    // Material Design
    implementation "androidx.compose.material:material:$jetpack_compose"
    // Material design icons
    implementation "androidx.compose.material:material-icons-core:$jetpack_compose"
    implementation "androidx.compose.material:material-icons-extended:$jetpack_compose"
    // Integration with observables
    implementation "androidx.compose.runtime:runtime-livedata:$jetpack_compose"
    implementation "androidx.compose.runtime:runtime-rxjava2:$jetpack_compose"

Top level build script

/ Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext.kotlin_version = "1.4.10"
    repositories {
    dependencies {
        classpath ""
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files

allprojects {
    repositories {

task clean(type: Delete) {
    delete rootProject.buildDir


I ran into the same issue. It worked for me after adding the following line in the app Gradle file

buildFeatures {
    compose true

Answered By – tashi

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published