When I try to build my project, the build fails with the error:
Plugin [id: 'com.android.tools.build', version: '8.7.2', apply: false] was not found in any of the following sources
After some debugging, I found that the path Android studio is using to download the pom is not correct:
android studio snippet
I've seen this question posted here various times, so I've checked that I have a compatible android gradle plugin with my gradle version. I have the correct min and target sdk for my gradle as well. I've cleaned, invalidated cache and rebuilt my project and still nothing.
Not sure what the issue is.
settings.gradle.kts:
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
rootProject.name = "Enthusiasm"
include(":app")
include(":models")
Root build.gradle.kts
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.7.2" apply false
id("com.android.tools.build") version "8.7.2" apply false
id("androidx.navigation.safeargs") version "2.7.6" apply false
}
:app build.gradle.kts
import .jetbrains.kotlin.ir.backend.jspile
plugins {
id("com.android.application")
id("androidx.navigation.safeargs")
}
android {
namespace = "com.bgprojects.enthusiasm"
compileSdk = 34
defaultConfig {
applicationId = "com.bgprojects.enthusiasm"
minSdk = 24
targetSdk = 34
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = 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.7.0")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.constraintlayout:constraintlayout:2.2.0")
implementation("androidx.navigation:navigation-fragment:2.8.4")
implementation("androidx.navigation:navigation-ui:2.8.4")
implementation("com.alphacephei:vosk-android:0.3.47")
implementation("com.android.tools.build:gradle:8.7.2")
implementation(project(mapOf("path" to ":models")))
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
}
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl = https\://services.gradle/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
IDE is trying to download the com.android.tools.build
from:
.android.tools.build.gradle.plugin/8.7.2/com.android.tools.build.gradle.plugin-8.7.2.pom
.android.tools.build.gradle.plugin/8.7.2/com.android.tools.build.gradle.plugin-8.7.2.pom
.android.tools.build.gradle.plugin/8.7.2/com.android.tools.build.gradle.plugin-8.7.2.pom
I'm not seeing much that would cause it to download from the incorrect URLs above.
When I try to build my project, the build fails with the error:
Plugin [id: 'com.android.tools.build', version: '8.7.2', apply: false] was not found in any of the following sources
After some debugging, I found that the path Android studio is using to download the pom is not correct:
android studio snippet
I've seen this question posted here various times, so I've checked that I have a compatible android gradle plugin with my gradle version. I have the correct min and target sdk for my gradle as well. I've cleaned, invalidated cache and rebuilt my project and still nothing.
Not sure what the issue is.
settings.gradle.kts:
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
rootProject.name = "Enthusiasm"
include(":app")
include(":models")
Root build.gradle.kts
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.7.2" apply false
id("com.android.tools.build") version "8.7.2" apply false
id("androidx.navigation.safeargs") version "2.7.6" apply false
}
:app build.gradle.kts
import .jetbrains.kotlin.ir.backend.jspile
plugins {
id("com.android.application")
id("androidx.navigation.safeargs")
}
android {
namespace = "com.bgprojects.enthusiasm"
compileSdk = 34
defaultConfig {
applicationId = "com.bgprojects.enthusiasm"
minSdk = 24
targetSdk = 34
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = 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.7.0")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.constraintlayout:constraintlayout:2.2.0")
implementation("androidx.navigation:navigation-fragment:2.8.4")
implementation("androidx.navigation:navigation-ui:2.8.4")
implementation("com.alphacephei:vosk-android:0.3.47")
implementation("com.android.tools.build:gradle:8.7.2")
implementation(project(mapOf("path" to ":models")))
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
}
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl = https\://services.gradle./distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
IDE is trying to download the com.android.tools.build
from:
https://dl.google/dl/android/maven2/com/android/tools/build/com.android.tools.build.gradle.plugin/8.7.2/com.android.tools.build.gradle.plugin-8.7.2.pom
https://repo.maven.apache./maven2/com/android/tools/build/com.android.tools.build.gradle.plugin/8.7.2/com.android.tools.build.gradle.plugin-8.7.2.pom
https://plugins.gradle./m2/com/android/tools/build/com.android.tools.build.gradle.plugin/8.7.2/com.android.tools.build.gradle.plugin-8.7.2.pom
I'm not seeing much that would cause it to download from the incorrect URLs above.
Share Improve this question asked Mar 28 at 19:04 Brian GonzalesBrian Gonzales 111 bronze badge1 Answer
Reset to default 0I don't know the full explanation for why Gradle is looking at those URLs, but as a workaround you could try also pointing Gradle directly at the Google Maven repo url and see if that makes any difference by adding the following to your pluginManagement.repositories {}
block:
maven("https://maven.google")