galsh
galsh

Reputation: 1

Failed to sync Gradle while connecting to Firebase

I tried (for the first time) to use Firebase and just follow after the instructors. After all the stages I had to sync the Gradle and it failed.

I tried to restart and it's still not working.

When I remove the plugin: apply plugin: 'com.google.gms.google-services'

It's working but I need it (of course).

The Error:

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.

Thanks a lot.

Upvotes: 0

Views: 504

Answers (3)

deengus
deengus

Reputation: 11

So the apply plugin: 'com.google.gms.google-services' should be id 'com.google.gms.google-services' since it's within the plugins{} brackets. That's what causes the issue.

Upvotes: 1

anusha anu
anusha anu

Reputation: 19

Try this once

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'

Upvotes: 0

Kidus
Kidus

Reputation: 474

Try to invalidate the caches and restart (if maybe the caches are corrupt):

File -> Invalidate Caches / Restart -> Invalidate and Restart

Upvotes: 0

Related Questions