You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In which task and step of the codelab can this issue be found?
Add typography, step 6
Describe the problem
This provided code does not build:
MaterialTheme(
colors = colors,
typography = Typography,
shapes = Shapes,
content = content
)
because
Type mismatch: inferred type is kotlin.text.Typography but androidx.compose.material3.Typography was expected
The solution is use to qualify the class:
MaterialTheme(
colorScheme = colorScheme,
shapes = Shapes,
typography = MaterialTheme.typography,
content = content
)
Steps to reproduce?
build
. See error above
Versions Android Studio version: Android Studio Koala | 2024.1.1 Patch 1
Build #AI-241.18034.62.2411.12071903, built on July 10, 2024
Runtime version: 17.0.11+0--11852314 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4074M
Cores: 16
API version of the emulator: not needed to reproduce
Additional information
The solution is to qualify the type of typography
MaterialTheme(
colorScheme = colorScheme,
shapes = Shapes,
typography = MaterialTheme.typography,
content = content
)
The text was updated successfully, but these errors were encountered:
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-compose-material-theming?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-3-pathway-3%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-material-theming#5
In which task and step of the codelab can this issue be found?
Add typography, step 6
Describe the problem
This provided code does not build:
MaterialTheme(
colors = colors,
typography = Typography,
shapes = Shapes,
content = content
)
because
Type mismatch: inferred type is kotlin.text.Typography but androidx.compose.material3.Typography was expected
The solution is use to qualify the class:
MaterialTheme(
colorScheme = colorScheme,
shapes = Shapes,
typography = MaterialTheme.typography,
content = content
)
Steps to reproduce?
. See error above
Versions
Android Studio version: Android Studio Koala | 2024.1.1 Patch 1
Build #AI-241.18034.62.2411.12071903, built on July 10, 2024
Runtime version: 17.0.11+0--11852314 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4074M
Cores: 16
API version of the emulator: not needed to reproduce
Additional information
The solution is to qualify the type of typography
MaterialTheme(
colorScheme = colorScheme,
shapes = Shapes,
typography = MaterialTheme.typography,
content = content
)
The text was updated successfully, but these errors were encountered: