googlemaps / googlemaps/android-maps-compose
Jetpack Compose Map throwing this when TalkBack is turned on. -> java.lang.IllegalStateException: LayoutNode should be attached to an owner
- Dominant language
- Kotlin
- Stars
- 1.3k
- Forks
- 181
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
Library version and other environment information
```
composeBOMVersion = "2023.06.01"
composeCompilerVersion="1.4.0-alpha02"
composeNavigationVersion = "2.5.3"
implementation 'com.google.maps.android:maps-compose:2.14.1'
implementation 'com.google.android.gms:play-services-maps:18.1.0'
```
#### Steps to reproduce
Turn on Talk back and Navigate to This compose
When TalkBack is turned off, the app works as expected
Crash Report

Code:
```
@Composable
fun LocationPickerScreen(
uiState: LocationPickerScreenContract.UiState,
) {
val configuration = LocalConfiguration.current
val screenHeight = configuration.screenHeightDp.dp
val currentLoc = uiState.locationInfo.addressLatLng
val cameraState = rememberCameraPositionState()
LaunchedEffect(key1 = currentLoc) {
cameraState.centerOnLocation(currentLoc)
}
val marker = LatLng(currentLoc.latitude, currentLoc.longitude)
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colors.background
) {
Box(
modifier = Modifier.fillMaxSize()
) {
GoogleMap(
modifier = Modifier
.fillMaxWidth()
.height(screenHeight - 300.dp)
.align(Alignment.TopCenter),
cameraPositionState = cameraState,
properties = MapProperties(
isMyLocationEnabled = true,
mapType = MapType.HYBRID,
isTrafficEnabled = true
)
) {
Marker(
state = MarkerState(position = marker),
title = "MyPosition",
snippet = "This is a description of this Marker",
draggable = true
)
}
Column(
modifier = Modifier
.fillMaxWidth()
.height(308.dp)
.align(Alignment.BottomCenter),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {
Text(
text = "Data Place Holder",
modifier = Modifier
.semantics {
contentDescription = "data"
}
.padding(bottom = 8.dp),
style = MaterialTheme.typography.body2.copy(
fontSize = 14.sp,
fontWeight = FontWeight.SemiBold,
lineHeight = 16.sp
),
)
}
}
}
}
private suspend fun CameraPositionState.centerOnLocation(
location: LatLng
) = animate(
update = CameraUpdateFactory.newLatLngZoom(
location,
15f
),
durationMs = 1500
)
```

Contributor guide
Assessment
This issue has not been assessed yet.