Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot access 'setContent': it is internal in 'androidx.compose.ui.platform'

I'm using

  • Android Studio 4.3 (Artix Fox | 2020.3.1 Canary 5),
  • compose_version = '1.0.0-beta01'
  • Kotlin version 1.4.30

When I open Empty Compose Activity and compile, I got the below error

e: MainActivity.kt: (9, 37): Cannot access 'setContent': it is internal in 'androidx.compose.ui.platform'

It's so strange as it is a template-generated project, and should work. Any workaround it?

like image 275
Elye Avatar asked Aug 24 '26 22:08

Elye


1 Answers

Add this line in your gradle

// In charge of setContent
implementation "androidx.activity:activity-compose:1.0.0-beta01"

activity-compose holds the reference for the setContent method you need

like image 191
Gastón Saillén Avatar answered Aug 27 '26 15:08

Gastón Saillén



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!