Google 地图未出现在 android jetpack compose Iguana 中

问题描述 投票:0回答:1

我想我已经使用谷歌地图将所有必要的东西连接到我的android项目,但地图既没有显示也没有显示任何错误。 在此输入图片描述

  1. 这是地图库在gradle.build(app)中的实现:
implementation(libs.maps.compose)
  1. 这是Manifest.xml 文件:
<meta-data android:name="com.google.android.geo.API_KEY"
            android:value="My API key"/>
  1. 主要活动:
@Composable
fun MapScreen() {
    val atasehir = LatLng(40.9971, 29.1007)
    val cameraPositionState = rememberCameraPositionState {
        position = CameraPosition.fromLatLngZoom(atasehir, 15f)
    }
    GoogleMap(
        modifier = Modifier.fillMaxSize(),
        cameraPositionState = cameraPositionState
    )
}

我想我在 Google Maps Platform 上也做了正确的事情: 在此输入图片描述

google-maps android-jetpack-compose google-maps-android-api-3
1个回答
0
投票

它在我的 Android 10 设备上运行良好enter image description here

检查您的 API 密钥。 您可以阅读此文档

© www.soinside.com 2019 - 2024. All rights reserved.