Android75
07/28/2022, 1:03 PMkotlinOptions.jvmTarget = "11"
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.3.0-rc01"
}
"androidx.compose.ui:ui:1.2.0"
"androidx.compose.material:material:1.2.0"
"androidx.compose.ui:ui-tooling-preview:1.2.0"
"androidx.activity:activity-compose"1.3.1"
here my actiivy
class MyActivityCompose : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Greeting("Android")
}
}
}
@Composable
fun Greeting(name: String) {
Text(text = "Hello $name!")
}
ad i have this error
java.lang.NoSuchMethodError: No static method setContent$default(Landroidx/activity/ComponentActivity;Landroidx/compose/runtime/CompositionContext;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V in class Landroidx/activity/compose/ComponentActivityKt; or its super classes (declaration of ‘androidx.activity.compose.ComponentActivityKt’ appears in /data/app/~~Ft9dSkXEHEzaK6HUxVW0Mw==/com.xxx.xxx.preprod-G6wAmGkpV4l7HVqxZrBhrg==/base.apk)Colton Idle
07/29/2022, 4:16 AMsvenjacobs
07/29/2022, 6:32 AMactivity-compose:1.3.1
is very old. Try to use 1.5.1
which is the current stable version.Colton Idle
07/29/2022, 7:41 AM