Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

705
Views
Jetpack de Android compone NoSuchMethodError: No hay método estático setContent

Versión de lanzamiento de Jetpack Compose: 1.0.0-alpha06 Compilación de Android Studio: 4.2 1Canery 15

mi actividad

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

Lo anterior cuando se ejecuta compila este 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)

algunas de mis configuraciones de gradle

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 "androidx.compose.foundation:foundation:$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"

Script de compilación de nivel superior

 / Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = "1.4.10" repositories { google() jcenter() } dependencies { classpath "com.android.tools.build:gradle:4.2.0-alpha15" 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 { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }
over 4 years ago · Hanz Gallego
2 answers
Answer question

0

Me encontré con el mismo problema. Funcionó para mí después de agregar la siguiente línea en el archivo Gradle de la aplicación

 buildFeatures { compose true }
over 4 years ago · Hanz Gallego Report

0

También tuve que eliminar la dependencia androidx.navigation:navigation-compose, ese era el problema para mí.

over 4 years ago · Hanz Gallego Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!