Reputation: 3902
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
Upvotes: 0
Views: 3639
Reputation: 7106
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.
Upvotes: 4