Home > database >  Android Studio's project gradle file changed?
Android Studio's project gradle file changed?

Time:01-28

I just updated Android Studio and started a new project. But now the project grade file seems different.

Here are the lines:

plugins {
    id 'com.android.application' version '7.1.0' apply false
    id 'com.android.library' version '7.1.0' apply false
}
 
task clean(type: Delete) {
    delete rootProject.buildDir
}

Now, for example, I need to paste the Firebase lines in the project level Gradle file. Where should I do it?

Here's the Firebase code:

buildscript {
  repositories {
    google()  // Google's Maven repository

  }
  dependencies {
    classpath 'com.google.gms:google-services:4.3.10'

  }
}

allprojects {
  repositories {
    google()  // Google's Maven repository

  }
}

In all of my previous projects, the Gradle structure was also like that. Now I'm a little confused about what to do.

CodePudding user response:

But now the project grade file seems different.

Yes, starting with the new Bumblebee update of Android Studio, the build.gradle (Project) file is changed. In order to be able to use Google Services, you have to add into your build.gradle (Project) file the following line:

plugins {
    id 'com.android.application' version '7.1.0' apply false
    id 'com.android.library' version '7.1.0' apply false
    id 'com.google.gms.google-services' version '4.3.0' apply false            
  •  Tags:  
  • Related