首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用react- Native -google-signin的React native中的play-services-auth依赖

使用react- Native -google-signin的React native中的play-services-auth依赖
EN

Stack Overflow用户
提问于 2015-12-26 08:43:57
回答 1查看 1.7K关注 0票数 0

我已经按照https://github.com/apptailor/react-native-google-signin的说明中的所有步骤在React Native中的安卓环境中进行了此设置(在iOS中没有问题),但在运行react-native run-android时遇到以下错误

代码语言:javascript
复制
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中添加了以下内容:

代码语言:javascript
复制
'com.google.gms:google-services:1.5.0'

并将以下内容添加到应用级build.gradle:

代码语言:javascript
复制
apply plugin: 'com.google.gms.google-services'
...
dependencies {
    ...
    compile project(":react-native-google-signin")
}

我尝试过不同版本的google-services,但最终还是得到了构建错误。在JCenter中,我甚至看不到com.google.android.gms.play-services-auth

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2015-12-26 12:49:03

通过在Android SDK管理器中添加Google RepositoryGoogle Play services修复了此问题。它在第一次构建时失败了,但后来由于某种原因完成了构建。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34467623

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档