Name of the Codelab or Codelab URL
Add a scrollable list (basic-android-kotlin-compose-training-add-scrollable-list)
https://developer.android.com/codelabs/basic-android-kotlin-compose-training-add-scrollable-list
Describe the problem
In the AffirmationsApp() code snippet, the Surface composable's modifier argument is written with an uppercase parameter name:
Surface(
Modifier = Modifier
.fillMaxSize()
...
)
This does not compile. Surface has no parameter named "Modifier"; its parameter is the lowercase "modifier". The correct code should use the lowercase parameter name: "modifier = Modifier.fillMaxSize()...".
In which lesson and step of the codelab can this issue be found?
Step 3, "Add a list to your app" — the AffirmationsApp() composable snippet that wraps AffirmationsList in a Surface.
How to reproduce?
- Open the codelab and go to step 3, "Add a list to your app".
- Copy the AffirmationsApp() code snippet exactly as shown on the page.
- Paste it into MainActivity.kt in Android Studio.
- Build the project. It fails with the compile error: "No parameter with name 'Modifier' found.".
- Changing the uppercase "Modifier =" to the lowercase "modifier =" resolves the error.
Versions
-
What version of Android Studio are you using?
-
What API level are you targeting?
-
Android Studio: Android Studio Otter | 2025.2.1 Patch 1
-
API level targeted: compileSdk 36 / targetSdk 36
Additional information
The intended snippet is:
modifier = Modifier
.fillMaxSize()
.statusBarsPadding()
.padding(...)
Here the lowercase "modifier" is the Surface parameter name. Only the casing of the parameter name is wrong in the published snippet.
codelab: basic-android-kotlin-compose-training-add-scrollable-list
Name of the Codelab or Codelab URL
Add a scrollable list (basic-android-kotlin-compose-training-add-scrollable-list)
https://developer.android.com/codelabs/basic-android-kotlin-compose-training-add-scrollable-list
Describe the problem
In the AffirmationsApp() code snippet, the Surface composable's modifier argument is written with an uppercase parameter name:
This does not compile. Surface has no parameter named "Modifier"; its parameter is the lowercase "modifier". The correct code should use the lowercase parameter name: "modifier = Modifier.fillMaxSize()...".
In which lesson and step of the codelab can this issue be found?
Step 3, "Add a list to your app" — the AffirmationsApp() composable snippet that wraps AffirmationsList in a Surface.
How to reproduce?
Versions
What version of Android Studio are you using?
What API level are you targeting?
Android Studio: Android Studio Otter | 2025.2.1 Patch 1
API level targeted: compileSdk 36 / targetSdk 36
Additional information
The intended snippet is:
Here the lowercase "modifier" is the Surface parameter name. Only the casing of the parameter name is wrong in the published snippet.
codelab: basic-android-kotlin-compose-training-add-scrollable-list