https://kotlinlang.org logo
#compose
Title
# compose
j

Justin Xu

03/22/2023, 1:28 AM
I'm getting a
None of the following candidates is applicable because of receiver type mismatch
error in my Android Activity code, even though it builds and runs without issues. I've posted pictures of the exact errors below. These are my imports for those two functions:
Copy code
import androidx.activity.compose.setContent
import androidx.activity.viewModels
These are my gradle imports:
Copy code
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.core:core-ktx:1.9.0")

// Lifecycle
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1")
i

Ian Lake

03/22/2023, 2:37 AM
Have you tried adding an explicit dependency on
activity-compose
?
19 Views