Could not parse the Android application Module’s Gradle Config. Resolve Gradle Build Issues

  android, android-studio, build.gradle, firebase

Im trying to setup Firebase in an Android Project and I got this error and I have searched for how to solve it, but I wasnt able to fix it

Error: Could not parse the Android application Module’s Gradle Config. Resolve Gradle Build Issues and/or resync.

The paragraph above is the error that I get when trying to setup Firebase.

Here follow the build.gradle files:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        def nav_version = "2.3.2"
        classpath "com.android.tools.build:gradle:4.1.1"
        classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

And the seconde one:

plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.example.stockmanager"
        minSdkVersion 28
        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
    }
}

dependencies {
    def nav_version = "2.3.2"

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

    implementation "androidx.navigation:navigation-fragment:$nav_version"
    implementation "androidx.navigation:navigation-ui:$nav_version"
    implementation "androidx.navigation:navigation-dynamic-features-fragment:$nav_version"
    androidTestImplementation "androidx.navigation:navigation-testing:$nav_version"
    implementation "androidx.navigation:navigation-compose:1.0.0-alpha05"
}

Would be great if someone could help, and thank you in advance.

Source: Android Questions

3 thoughts on - Could not parse the Android application Module’s Gradle Config. Resolve Gradle Build Issues

  • Delete jCenter()
    in the code
    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    buildscript {
    repositories {
    google()
    jcenter()
    }
    dependencies {
    def nav_version = “2.3.2”
    classpath “com.android.tools.build:gradle:4.1.1”
    classpath “androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version”

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    }
    }

    allprojects {
    repositories {
    google()
    jcenter()
    }
    }

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

LEAVE A COMMENT