-
Notifications
You must be signed in to change notification settings - Fork 173
Closed
Labels
π¨This issue needs some love.This issue needs some love.releasedtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Hello,
I'm working with Google Maps Compose and now I get some Firebase crashes related to markerComposable withe the following exception:
Fatal Exception: java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:1148)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1115)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1065)
at android.graphics.Bitmap.createBitmap(Bitmap.java:1026)
at com.google.maps.android.compose.RememberComposeBitmapDescriptorKt.renderComposableToBitmapDescriptor(RememberComposeBitmapDescriptor.kt:58)
at com.google.maps.android.compose.RememberComposeBitmapDescriptorKt.access$renderComposableToBitmapDescriptor(RememberComposeBitmapDescriptor.kt:1)
at com.google.maps.android.compose.RememberComposeBitmapDescriptorKt.rememberComposeBitmapDescriptor(RememberComposeBitmapDescriptor.kt:29)
at com.google.maps.android.compose.MarkerKt.MarkerComposable-pMp3byo(Marker.kt:239)
```
this is my following code :
@Composable
fun MapScreen(
...
) {
GoogleMap(
modifier = Modifier
.fillMaxWidth()
.padding(bottom = sheetPeekHeight - 8.dp),
cameraPositionState = cameraPositionState,
properties = if (locationPermissionState.status.isGranted) MapProperties(isMyLocationEnabled = true) else MapProperties(
isMyLocationEnabled = false
),
uiSettings = MapUiSettings(zoomControlsEnabled = false)
) {
LocationMarkers(locations, getMarkerSequence)
}
}
@Composable
fun LocationMarkers(
locations: List<LatLng>,
getMarkerSequence: (Int) -> String
) {
locations.onEachIndexed { index, latLng ->
MarkerComposable(
state = MarkerState(latLng),
) {
val markerSequence = getMarkerSequence(index)
Box(contentAlignment = Alignment.Center) {
Image(
painter = painterResource(id = R.drawable.ic_my_icon),
contentDescription = ""
)
Text(
text = markerSequence,
color = Color.White,
modifier = Modifier
.padding(top = 4.dp)
.align(Alignment.TopCenter)
)
}
}
}
}
Environment details
- API Google Maps compose
- it's happening at multiple Version From Android 9 ->14
- Google Maps compose version v2.14.0
Steps to reproduce
- I can't reproduce my local but the crashes caught by Firebase affect around 1% of the users
Thanks!
Abdelsattar, lx-felipe, mregtej, danieledigregorio, carlosjuarezflash and 15 moremregtej and CarloskHard
Metadata
Metadata
Labels
π¨This issue needs some love.This issue needs some love.releasedtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.