我已经按照https://github.com/apptailor/react-native-google-signin的说明中的所有步骤在React Native中的安卓环境中进行了此设置(在iOS中没有问题),但在运行react-native run-android时遇到以下错误
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-google-signin'.
> Could not resolve all dependencies for configuration ':react-native-google-signin:_debugCompile'.
> Could not find com.google.android.gms:play-services-auth:8.3.0.
Searched in the following locations:
file:/Users/steven/.m2/repository/com/google/android/gms/play-services-auth/8.3.0/play-services-auth-8.3.0.pom
file:/Users/steven/.m2/repository/com/google/android/gms/play-services-auth/8.3.0/play-services-auth-8.3.0.jar
https://jcenter.bintray.com/com/google/android/gms/play-services-auth/8.3.0/play-services-auth-8.3.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services-auth/8.3.0/play-services-auth-8.3.0.jar
file:/usr/local/opt/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-auth/8.3.0/play-services-auth-8.3.0.pom
file:/usr/local/opt/android-sdk/extras/android/m2repository/com/google/android/gms/play-services-auth/8.3.0/play-services-auth-8.3.0.jar
Required by:
PowerToolSafe:react-native-google-signin:unspecified我在顶层build.gradle中添加了以下内容:
'com.google.gms:google-services:1.5.0'并将以下内容添加到应用级build.gradle:
apply plugin: 'com.google.gms.google-services'
...
dependencies {
...
compile project(":react-native-google-signin")
}我尝试过不同版本的google-services,但最终还是得到了构建错误。在JCenter中,我甚至看不到com.google.android.gms.play-services-auth。
谢谢!
发布于 2015-12-26 12:49:03
通过在Android SDK管理器中添加Google Repository和Google Play services修复了此问题。它在第一次构建时失败了,但后来由于某种原因完成了构建。

https://stackoverflow.com/questions/34467623
复制相似问题