google-developer-training / basic-android-kotlin-compose-birthday-card-app

Apache License 2.0
125 stars 95 forks source link

First Android app: Android Basics with Compose #900

Closed Sarthak635 closed 2 weeks ago

Sarthak635 commented 2 weeks ago

URL of codelab https://developer.android.com/codelabs/basic-android-kotlin-compose-first-app?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-1-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-first-app#4

In which task and step of the codelab can this issue be found? Step 5. Change the background color

Describe the problem Showing render error after following the steps.

Steps to reproduce?

  1. follow the steps to change background color

Versions Android Studio version: Ladybug 2024.2.1 API version of the emulator:

Additional information this function is not required: @Composable fun Surface(color: Color, content: @Composable () -> Unit) { TODO("Not yet implemented") } This Surface function is a placeholder that triggers an exception when called because of the TODO statement inside. This is useful as a reminder to implement the function later, but in this case, I didn’t actually need to define a custom Surface function at all. Instead, Android's Compose Material3 library already has a built-in Surface component, designed to handle common UI tasks like background color and layout, which you can import and use directly.