Android Studio's Project Gradle File Changed

Android Studio's project gradle file changed?

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 to your build.gradle (Project) file the following lines:

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 br>}

task clean(type: Delete) {
delete rootProject.buildDir
}

And inside your build.gradle (Module) file, the following plugin IDs:

plugins {
id 'com.android.application'
id 'com.google.gms.google-services' br>}

In this way, your Firebase services will finally work.

P.S. Not 100% sure if the Firebase Assistant is updated with these new Android Studio changes.

Edit 2022-14-07:

Here is a repo that uses this new structure:

  • https://github.com/alexmamo/FirestoreCleanArchitectureApp

Edit:

There is nothing changed regarding the way you add dependencies in the build.gradle (Module) file. If for example, you want to add Firestore and Glide, please use:

dependencies {
//Regular dependecies
implementation platform("com.google.firebase:firebase-bom:29.0.4")
implementation "com.google.firebase:firebase-firestore"
implementation "com.github.bumptech.glide:glide:4.12.0"
}

Edit2:

With the new updates, you don't need to worry about adding any lines under the repositories { }. That was a requirement in the previous versions.

Gradle File Change After Update Android studio Chipmunk

You can manually add buildscript and dependencies tag so your whole build.gradle (project level) will look like this:

buildscript {
dependencies {
classpath 'com.google.gms:google-services:4.3.10'
// other dependencies you wanna add
}
}

plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.0' apply false
}

task clean(type: Delete) {
delete rootProject.buildDir
}

Gradle file changed Mistakenly android

First Close your Android Studio.

Go to your C: Drive. Follow Path: C://Users/yourUserName/.AndroidStudio3.4

There is .AndroidStudio Folder. Delete that folder. Then start studio again. Setup things studio asked, and you will get your project back with proper code.



Related Topics



Leave a reply



Submit