Google地图未使用react-native-maps显示/空白

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

我正在使用react-native-maps在我的页面中显示Mapview,不幸的是它在Iphone中工作但没有在android中显示Mapview,它只显示了logo,是的我在文档中提到了所有配置步骤。

  1. 使用以下命令安装react-native-maps: npm install react-native-maps --save
  2. 链接地图: react-native link react-native-maps
  3. 检查android/settings.gradle中的react-native-maps项​​目: include ':react-native-maps' project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
  4. 检查qazxsw poi中应用的依赖关系: qazxsw poi
  5. 检查android/app/build.gradledependencies { ... compile project(':react-native-maps') ... }
  6. android/build.gradle中指定您的Google Maps API密钥: ext { buildToolsVersion = "27.0.3" minSdkVersion = 16 compileSdkVersion = 27 targetSdkVersion = 26 supportLibVersion = "27.1.1" googlePlayServicesVersion = "11.8.0" androidMapsUtilsVersion = "0.5+" }

这是我的android/app/src/main/AndroidManifest.xml文件依赖项

  <meta-data 
      android:name="com.google.android.maps.v2.API_KEY"
      android:value="MY API KEY"/>
react-native react-native-android react-native-maps
1个回答
0
投票

在元数据标记中使用此代码而不是v2:

package.json
© www.soinside.com 2019 - 2025. All rights reserved.