Home > Enterprise >  android studio gradle plugin problems out of the box
android studio gradle plugin problems out of the box

Time:07-28

just installed android studio after getting a fresh install of win10. i created a new empety project and got this error:

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

this is the code:

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.6.10' apply false
}

Edit: the sources were blank and the path to the file is C:\Users\RK33DV\AndroidStudioProjects\test\build.gradle

CodePudding user response:

The problem is you're missing settings.gradle file. Try to add settings.gradle file to your project root directory with the following content:

pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}
rootProject.name = "projectName"
include ':app'
  • Related