无法使 react-native-maps 在 android 上工作

Cannot make react-native-maps to work on android

我正在尝试在 Android 上使用 react-native 创建一个简单的 "weather" 应用程序。

我遵循了 installation steps 但是当我 运行 react-native run-android

时出现以下错误

JS 服务器已经 运行ning。 在设备上构建和安装应用程序 (cd android && ./gradlew installDebug)...

失败:构建失败,出现异常。

* 出了什么问题: 配置项目“:app”时出现问题。

A problem occurred configuring project ':react-native-maps'. Could not resolve all dependencies for configuration ':react-native-maps:_debugCompile'. Could not find com.google.android.gms:play-services-base:8.3.0. Searched in the following locations: file:/home/mihir/.m2/repository/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.pom file:/home/mihir/.m2/repository/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.jar https:// jcenter.bintray.com/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.pom https:// jcenter.bintray.com/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.jar file:/home/mihir/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.pom file:/home/mihir/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.jar Required by: weather:react-native-maps:unspecified Could not find com.google.android.gms:play-services-maps:8.3.0. Searched in the following locations: file:/home/mihir/.m2/repository/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.pom file:/home/mihir/.m2/repository/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.jar https:// jcenter.bintray.com/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.pom https:// jcenter.bintray.com/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.jar file:/home/mihir/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.pom file:/home/mihir/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.jar Required by: weather:react-native-maps:unspecified

* 尝试: 运行 使用 --stacktrace 选项获取堆栈跟踪。 运行 使用 --info 或 --debug 选项以获得更多日志输出。

构建失败

总时间:20.584 秒 无法在设备上安装应用程序,rea

您需要安装 Google Play 服务才能使 react-native-maps 在 Android.

上运行

进入终端并 运行 android。这应该会打开 SDK 管理器。

如果没有找到命令android,您需要从here

安装SDK工具

安装 Google Play 服务和 Google 存储库。

Re运行 react-native run-android如果您使用设备,它应该可以工作。

如果您使用模拟器,请勾选 this