简体   繁体   中英

Cannot make react-native-maps to work on android

I'm trying to create a simple "weather" app using react-native on Android.

I have followed the installation steps but I get following errors when I run react-native run-android

JS server already running. Building and installing the app on the device (cd android && ./gradlew installDebug)...

FAILURE: Build failed with an exception.

* What went wrong: A problem occurred configuring project ':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

* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 20.584 secs Could not install the app on the device, rea

You need to install Google Play Services to make react-native-maps work on Android.

Go in a terminal and run android . This should open the SDK manager.

If the command android is not found, you need to install the SDK tools from here

Install Google Play Services and Google Repository.

在此处输入图片说明

Rerun react-native run-android and it should work if you use a device.

If you use an emulator, check this .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM