lol, already the first issue running the first step in Google's tutorial:
Copy code
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Text("Hello world!")
}
}
}
java.lang.NoSuchMethodError: No static method setContent$default(Landroidx/activity/ComponentActivity;Landroidx/compose/Recomposer;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Landroidx/compose/Composition; in class Landroidx/ui/core/WrapperKt; or its super classes (declaration of 'androidx.ui.core.WrapperKt' appears in /data/app/com.match.android-863fKnuh3LTaDvTF4A7agg==/base.apk)
a
andylamax
07/11/2020, 10:34 AM
I have battled with that error since the release of Compose. You either have the wrong compiler version, or instead of using the kotlin-android plugin, you are using the kotlin-multiplatform plugin. For now stick to the current compiler version as instructed by compose and do not use the kotlin-multiplatfrom gradle plugin. It doesn't support compose just yet
i
iex
07/11/2020, 10:40 AM
yeah, it seems that I was missing some configuration steps
iex
07/11/2020, 11:12 AM
it works now 👍
t
Timo Drick
07/11/2020, 11:15 AM
You should also inherit from this: class MainActivity: ComponentActivity()
Maybe it is not so important. But my app is under 2 mb (including Kotlin runtime and Compose runtime) and when you are using AppCompatActivity you have to depend on this appcompat libraries which will increase the App size.