【问题标题】:Failed to sync Gradle while connecting to Firebase连接到 Firebase 时无法同步 Gradle
【发布时间】:2021-01-02 11:32:03
【问题描述】:

我尝试(第一次)使用 Firebase 并跟随讲师。 经过所有阶段后,我不得不同步 Gradle,但它失败了。

我试过重启,还是不行。

当我删除插件时:apply plugin: 'com.google.gms.google-services'

它正在工作,但我需要它(当然)。

错误:

org.codehaus.groovy.ast.expr.TupleExpression cannot be cast to org.codehaus.groovy.ast.expr.ArgumentListExpression
org.codehaus.groovy.ast.expr.TupleExpression cannot be cast to org.codehaus.groovy.ast.expr.ArgumentListExpression

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

非常感谢。

【问题讨论】:

    标签: java android firebase gradle groovy


    【解决方案1】:

    尝试使缓存无效并重新启动(如果缓存可能已损坏):

    文件 -> 使缓存无效/重新启动 -> 无效并重新启动

    【讨论】:

      【解决方案2】:

      试试这个

      implementation 'com.google.firebase:firebase-firestore:17.1.5'
      implementation 'com.google.firebase:firebase-auth:16.1.0'
      implementation 'com.google.firebase:firebase-messaging:17.3.4'
      implementation 'com.google.firebase:firebase-core:16.0.4'
      

      【讨论】:

        【解决方案3】:

        所以apply plugin: 'com.google.gms.google-services' 应该 id 'com.google.gms.google-services' 因为它在 plugins{} 括号内。这就是导致问题的原因。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2020-11-29
          • 1970-01-01
          • 1970-01-01
          • 2021-08-03
          • 2018-11-13
          • 1970-01-01
          • 2019-04-23
          相关资源
          最近更新 更多