错误:任务“:app:processDebugGoogleServices”执行失败。将 com.google.android.gms 版本更新至 10.2.6

2024-02-24

我正在尝试通过 Firebase 在我的 Android 应用程序中实现 Google 登录,并且在 Gradle 同步后不断出现以下消息:

错误:任务“:app:processDebugGoogleServices”执行失败。 请通过更新 google-services 插件的版本来解决版本冲突(有关最新版本的信息可在https://bintray.com/android/android-tools/com.google.gms.google-services/ https://bintray.com/android/android-tools/com.google.gms.google-services/)或将 com.google.android.gms 版本更新至 10.2.6。

我该如何修复这个错误?

这是我的 Gradle 文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.sjf.lgcats"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 2
        versionName "1.0.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/2'] } }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:support-vector-drawable:25.3.1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.google.firebase:firebase-auth:10.2.6'
    compile 'com.google.firebase:firebase-messaging:10.2.6'
    compile 'com.google.firebase:firebase-auth:11.0.0'
    compile 'com.google.android.gms:play-services-auth:11.0.0'
    compile 'commons-io:commons-io:2.0.1'
    testCompile 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'

对所有 Firebase 和 Google Play 库使用相同的版本:

compile 'com.google.firebase:firebase-auth:11.0.0'
compile 'com.google.firebase:firebase-messaging:11.0.0'
compile 'com.google.android.gms:play-services-auth:11.0.0'

在进行更改时,您还可以使用最新版本的构建工具:

buildToolsVersion "26.0.0"

您可以通过执行以下操作来简化版本号的维护并确保它们始终一致:

ext {
    SUPPORT_LIB_VER = '25.3.1'
    GOOGLE_LIB_VER = '11.0.0'
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile "com.android.support:appcompat-v7:$SUPPORT_LIB_VER"
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile "com.android.support:design:$SUPPORT_LIB_VER"
    compile "com.android.support:support-vector-drawable:$SUPPORT_LIB_VER"
    compile "com.android.support:support-v4:$SUPPORT_LIB_VER"
    compile "com.google.firebase:firebase-auth:$GOOGLE_LIB_VER"
    compile "com.google.firebase:firebase-messaging:$GOOGLE_LIB_VER"
    compile "com.google.android.gms:play-services-auth:$GOOGLE_LIB_VER"
    compile 'commons-io:commons-io:2.0.1'
    testCompile 'junit:junit:4.12'
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

错误:任务“:app:processDebugGoogleServices”执行失败。将 com.google.android.gms 版本更新至 10.2.6 的相关文章

  • Twowayview 滚动时自动添加内边距

    我在用双向视图 https github com lucasr twoway view在我的一个项目中 这是android的扩展回收者视图 https developer android com reference android supp
  • 如何在android中批量插入sqlite

    我正在使用 SQLiteOpenHelper 进行数据插入 我需要插入2500个id和2500个名字 所以花费了太多时间 请任何人帮助我如何减少插入时间 我们可以一次插入多条记录吗 任何人都可以帮助我 先感谢您 代码 public clas
  • 地理编码 API 与地理编码器

    在我的应用程序中 我需要使用地理编码 但我不太清楚该使用哪种方法 直到昨天我在URL中添加了参数maps googleapis com maps api geocode json address myparameter sensor fal
  • 从 Firestore 获取文档时,我是否也获取该文档内的集合?

    如果是的话 如何获得它 因为在进行文档引用时 您只能访问该文档的字段 而不能访问集合 从 Firestore 获取文档时 我是否也得到了 该文档内的集合 不 当获取文档时 您只会获取该文档的字段 正如本节中所解释的document http
  • 如何将现有的 SQLite3 数据库导入 Room?

    好吧 我在桌面上使用 SQLite3 创建了一个只需要读取的某些信息的数据库 我正在制作的应用程序不需要在此表中插入或删除信息 我在 Room 数据库层上做了相当多的谷歌搜索 所有文档都需要在构建应用程序时在 Room 中创建一个新的数据库
  • React Native 无法访问 Cloud Firestore 后端

    我之前使用的是 firebase 实时数据库 但现在想切换到 Cloud Firestore 但即使经过身份验证 也会收到以下错误 我目前正在使用 Android Simulator 尝试禁用我的实时数据库 但找不到解决方案 Firebas
  • 作为附件的 Android 设备

    我有 2 个 Android 设备 我想用 USB OTG 电缆连接它们 并在两个设备之间进行来回通信 据我了解 一台 Android 设备将充当 USB 主机 运行 4 4 的 Nexus 7 另一台 Android 设备将充当 USB
  • startActivityForResult中的requestCode是什么意思

    我想知道我是否正确理解 requestCode 的概念 这个整数的用途是什么 我将其设置为哪个整数有关系吗 private static int CAMERA REQUEST 谢谢 requestCode 可帮助您识别您从哪个 Intent
  • 动态地将textView添加到线性布局中

    我在这里的某个地方读过这篇文章 但我完全迷失了 但我需要一些帮助 我的应用程序正在将列名称从 sqlite 拉入数组中 我想创建一个文本视图并为每个视图编辑文本 通过数组的大小 我记得在某处读过 您可以将 textViews 变量名称视为数
  • Android volley使用RequestFuture.get()时出现超时异常

    在我的片段中 我尝试使用 TMDB 的开放电影数据库来获取有关 正在播放 电影的详细信息 如果我使用 RequestFuture get time TimeUnit 方法来执行此齐射请求 我总是会收到超时错误 如果我在 Safari 中手动
  • 当 Firebase 函数以 Swift 结束时

    我在我的应用程序中使用 Firebase 它查询大量用户并获取所需的特定数据 但是当它开始查询时 其余功能也继续运行 而不仅仅是查询 所以我无法理解当它结束时 例如在这段代码中 ref observeEventType ChildAdded
  • Android:如果任务管理器终止,则重新调用应用程序

    如果应用程序线程被任务管理器杀死 则应用程序线程将关闭 需要重新调用应用程序 就像它被其他应用程序或任务管理器杀死一样 任何想法 您必须使用 START STICKY 命令运行后台服务 只需扩展 Service 并重写 onCommand
  • Android 媒体播放器搜索栏

    我有一个创建 播放和处理媒体播放器 只是音频 的服务 但我在主要活动中有一个搜索栏 我想自然地显示音频文件的进度并允许用户搜索到不同的位置 我花了很长时间才弄清楚 将 UI 中的搜索栏连接到服务中的媒体播放器的最佳或正确方法是什么 我将这样
  • phonegap html5 android 同步文件系统 IO

    如何使用 PhoneGaps 文件系统 API 同步读写文件 有可用的同步包装器吗 无法通过提供的 api 同步访问文件 从phonegap的实现方式猜测 我怀疑您是否可以编写一个插件来同步执行此操作
  • Android项目中使用java获取电脑的IP地址

    我在用ksoap2 android http code google com p ksoap2 android 我需要使用java获取IP地址 这样我就不必每次都手动输入它 我所说的 IP 地址是指 例如 如果我这样做ipconfig使用命
  • 按“重置应用程序首选项”后,我的应用程序的所有权限都被撤销

    我开发了一个应用程序 支持Android 6 0 当我在 设置 gt 应用程序 gt 重置应用程序首选项 中重置应用程序首选项时 我的应用程序的所有权限都将被撤销 并且应用程序不会重新启动 撤销权限后未能重新启动应用程序可能会导致许多意外崩
  • Android - 如何简单地拖放按钮?

    我在这里找到了一个适合初学者的教程 http androidrox wordpress com 2011 05 13 android sample app drag and drop image using touch http andro
  • 如何减少 Android 中浮动 editText 提示和 editText 框之间的空间?

    我有一个带有浮动提示的 EditText 但我想知道如何减少浮动提示和 EditText 框之间的空间 现在我的用户界面看起来像https i stack imgur com ltfra jpg https i stack imgur co
  • 在 Qt 中构建 Android 项目不再有效

    所以我对 Android SDK NDK 和 Apache Ant 进行了一些更新 现在我无法构建任何 Android 项目 我收到一条警告 然后它说找不到 build xml 文件 错误 Warning Android platform
  • Android 版本低于 Lollipop 时出现 java.lang.NoClassDefFoundError

    我有一台运行 Android 21 的 Nexus 5 设备 我正在测试我的项目 没有任何问题 但是 如果我使用 Google API 19 在模拟器上进行测试 则会显示错误java lang NoClassDefFoundError 如果

随机推荐