Sunday 26 June 2022

New project fails building in Android Studio Chipmunk 2021.2.1 patch 1

When I create a new project (with the default settings, wasn't modified) in the newest Android Studio version (no more updates available) I get this message:

Build file 'C:\Users\user\AndroidStudioProjects\MyApplication\build.gradle' line: 3

Plugin [id: 'com.android.application', version: '7.2.1', apply: false] was not found in any of the following sources:

While I can open projects that were created with an older version just fine.

This is the default project structure:


build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.2.1' apply false
    id 'com.android.library' version '7.2.1' apply false
}

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

app/build.gradle:

plugins {
    id 'com.android.application'
}

android {
    compileSdk 32

    defaultConfig {
        applicationId "com.example.myapplication"
        minSdk 23
        targetSdk 32
        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 {

    implementation 'androidx.appcompat:appcompat:1.4.2'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

enter image description here


I tried to lower the APG version, reinstall Android Studio, reset to default settings, but it still fails.
How can I resolve this error?



from New project fails building in Android Studio Chipmunk 2021.2.1 patch 1

No comments:

Post a Comment