android - 在 react-native-google-signin 中找不到方法 exclude()

标签 android gradle react-native

我是新手,所以在使用 react-native-google-signin 库时我需要有关我的 gradle 依赖项的帮助,我不确定是我错过了它还是只是输错了一些东西,因为我已经关注了从此 repo 一步一步: https://github.com/devfd/react-native-google-signin/blob/master/android-guide.md ,但我的 build.gradle 脚本无法编译。

这是我在 app/build.gradle 中的依赖项:

dependencies {
    compile project(':react-native-maps')
    compile project(':react-native-fetch-blob')
    compile project(':react-native-fbsdk')
    compile project(':react-native-oauth')
    compile project(':react-native-linear-gradient')
    compile project(':react-native-fcm')
    compile project(':react-native-device-info')
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:24.0.1'
    compile 'com.facebook.react:react-native:+'
    // From react-native-sign-in
    compile project(':react-native-google-signin'){
        exclude group: "com.google.android.gms"
    }
    compile 'com.google.android.gms:play-services-auth:9.2.1'

    compile('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
        transitive = true;
    }
    compile project(':react-native-image-picker')
}

当我在终端中运行命令 'react-native run-android' 时,我遇到了这个错误:

Could not find method exclude() for arguments [{group=com.google.android.gms}] on project ':react-native-google-signin' of type org.gradle.api.Project.

所以我所拥有的应该可以工作,但我很困惑为什么它不工作。 有解决办法吗?

最佳答案

你试过吗:

compile(project(':react-native-google-signin')) {
  exclude group: "com.google.android.gms"
 }

关于android - 在 react-native-google-signin 中找不到方法 exclude(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45072802/

相关文章:

php - 将远程数据库 (mysql) 与 sqlite 数据库同步,反之亦然

Android: 当 Activity 回到前台时,AlertDialog 是不可见的

gradle - 如何为多项目Gradle构建创建单个CodeNarc报告

javascript - 在 UIManager 中找不到 "RNCSafeAreaView"

animation - 将 PanResponder 与 Animated.event 结合使用

android - bindView 和 newView 用于 CursorAdapter 中的两个 View 布局

scala - gradle 中的影子插件无法正常工作 - gradle build 不会构建 fat jar

react-native - 在 React Native 上通过 Auth0 进行 Instagram 身份验证(不是登录)?

ios - React Native Expo 弹出应用程序,无法从设备获取推送 token

java - 如何为每个数组元素创建一个数组?