有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java在连接到Firebase时无法同步Gradle

我尝试(第一次)使用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.

非常感谢


共 (3) 个答案

  1. # 1 楼答案

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

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

  2. # 2 楼答案

    所以apply plugin: 'com.google.gms.google-services' 应该是 id 'com.google.gms.google-services'因为它位于插件{}括号内。这就是问题的原因

  3. # 3 楼答案

    试试这个

    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'