google-developer-training / basic-android-kotlin-compose-training-woof

Apache License 2.0
55 stars 87 forks source link

Simple Animation with Jetpack Compose #73

Open Dharhix opened 1 year ago

Dharhix commented 1 year ago

[URL of codelab] https://developer.android.com/codelabs/basic-android-kotlin-compose-woof-animation

At "Display the DogItemButton() composable by adding it to the layout."

When I type the code, specifically: "var expanded by remember { mutableStateOf(false) }" importing using ALT-ENTER or manually doing it or even using "import androidx.compose.runtime.*" I ALWAYS get the following errors.

Specifically: "Type 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<>)' and thus it cannot serve as a delegate" and "Type 'MutableSet' has no method 'setValue(Nothing?, KProperty<>, [Error type: Error delegation type for remember { mutableSetOf(false) }])' and thus it cannot serve as a delegate for var (read-write property)" both.

Versions I run Android Studio Giraffe 2022.3.1 Patch 3 Build #AI-223.8836.35.2231.11005911 Build on Oct. 25, 2023 Runtime version: 17.0.6+0-b2043.56-10027231 amd64

Additional information As someone who has started learning Kotlin recently, I find this IDE bug (apparently from all the google hits I've checked) very annoying. Please this needs to be fixed or the learning material has to be properly with step by step instructions on how to fix/avoid the problem.