Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not Link/Connect Android Studio with Firebase

I have been trying to connect Android studio 4.1 with Firebase but it is not getting linked. I followed the instruction given on the firebase website like copying the dependencies, plugins, etc. into the app Gradle build and Project Gradle Build. My Gradle version is 6.5 and Gradle plugin is 4.1. The Error shown is:

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. Error Description In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

like image 309
Nishant Sahasrabuddhe Avatar asked Oct 26 '20 14:10

Nishant Sahasrabuddhe


People also ask

Why cant I connect to Firebase in Android Studio?

You will receive this error if you have open different accounts between Android Studio and Firebase. Because the Firebase assistant attempts to contact the Firebase service with your account registered in Android Studio. You can resolve this error by selecting the Add account option in Android Studio.

Why my app is not connecting to Firebase?

Please refresh the page and try linking your app again. If you still have issues: Confirm that you're using the same email address for both AdMob and Firebase. Confirm that the project you're linking to hasn't been deleted.

Is Firebase compatible with Android Studio?

You can explore and integrate Firebase services in your app directly from Android Studio using the Assistant window shown in figure 1.


2 Answers

I believe i found the problem. If you use

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

to your build.gradle(module) like its instructed you get this error.

Instead change apply plugin to id

id 'com.google.gms.google-services'

I haven't finish the app but when I sync, it's successful

like image 166
Çağrı Kırt Avatar answered Sep 21 '22 16:09

Çağrı Kırt


Using the Firebase guide to link my app with Firebase, the problem is that you have to scatter the plugins by these 2 ways of implementation:

//First way to implement plugins
plugins {
    id 'com.android.application'
    id 'kotlin-android'
}

//Second way to implement plugins
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

Taking out the apply plugin ones from the {} of plugins solved my link issues ;)

like image 42
jose antonio Jimenez Avatar answered Sep 21 '22 16:09

jose antonio Jimenez