android studio firebase error: "Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and/or resync."

This is my first time using firebase with android studio and I want to use the real time database.When I click to connect to firebase inside the assistant I get the message "Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and/or resync." I've seen many answers for this here and each person deletes something different .

I have no idea what I should delete from my module and I could use your help .

My build.gradle module

plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.example.covid19gate"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildFeatures {
        viewBinding true
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
    implementation 'androidx.navigation:navigation-fragment:2.3.5'
    implementation 'androidx.navigation:navigation-ui:2.3.5'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.yarolegovich:discrete-scrollview:1.5.1'

    implementation("com.squareup.okhttp3:logging-interceptor:4.9.1")
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

Upvotes: 0

Views: 2061

Answers (1)

ADITYA RANADE
ADITYA RANADE

Reputation: 293

Go to the build.gradle file of your "Project" (Not the App)

allprojects {
    repositories {
        google()
        mavenCentral()
    }
} 

and remove the jcenter()line from there

Upvotes: 1

Related Questions