Since I upgraded my project to Android Gradle Plugin 7.1.3, I can’t build it anymore.
Error :
Plugin [id: ‘com.android.application’, version: ‘7.1.3’, apply: false] was not found in any of the following sources:
Try: Run with –info or –debug option to get more log output. Run with –scan to get full insights.
Exception is: org.gradle.api.plugins.UnknownPluginException: Plugin [id: ‘com.android.application’, version: ‘7.1.3’, apply: false] was
not found in any of the following sources:
- Gradle Core Plugins (plugin is not in ‘org.gradle’ namespace)
- Plugin Repositories (could not resolve plugin artifact ‘com.android.application:com.android.application.gradle.plugin:7.1.3’)
Searched in the following repositories:
Gradle Central Plugin Repository
MavenRepo
build.gradle :
plugins {
id 'com.android.application' version '7.1.3' apply false
id 'com.android.library' version '7.1.3' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
settings.gradle :
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
include ':app'
rootProject.name = "MyApp"
The problem occurred after I clicked the "Begin Upgrade" button below the following message :
To take advantage of the latest features, improvements, and security
fixes, we strongly recommend that you upgrade the Android Gradle
Plugin in this project (MyApp) from the current version 7.1.2 to
version 7.1.3.
6
Answers
Android Gradle Plugin 7.1.3 has been released. Problem solved.
I checked in my build.gradle file and saw that my plugin version is as below
It is the latest and February-released version click the below link for getting info on the Gradle version.
https://developer.android.com/studio/releases/gradle-plugin#7-1-0
I checked all versions but have not found the
7.1.3
version. If you entered this version manually then make them7.1.2
as code above and run again. Because error is also say that version7.1.3
not not found in any of the following sourcesIf the problem is the same. Let me know.
I just had this problem too after receiving a recommendation to upgrade Gradle plugin, here’s what I did,
I changed the following
in the build.gradle(Project: MyProjectName)
to this
and clicked on ‘try again’
it SOLVED my issue
Your plugin imports look odd to me
I would only expect to see one of these; either the application if this is your application module, or the library if this is a library module. Maybe try removing the one you don’t need?
As an aside, I have just done the same upgrade as you, from 7.1.2 to 7.1.3, and it worked fine.
I’ve no idea how the distribution system works but another option might be that as it seems like it’s just been released maybe whatever content delivery network your computer is connecting to hasn’t received the update and if you just wait a bit and try again it might work.
This is a known bug, see here:
https://issuetracker.google.com/228336564
https://issuetracker.google.com/228336572
https://issuetracker.google.com/228340263
https://issuetracker.google.com/228340265
I know I am late in answering to this query and I am also aware that Android Gradle Plugin 7.1.3 has been released which solved the problem. But I just found out another issue with android studio and that is, when you’re in proxy network. When in proxy network and we apply proxy settings and then if you switch to non-proxy network then the proxy details are still saved inside gradle.properties(Global Properties) file and that details are causing trouble to connect and download gradle files when we switch to non-proxy network. I faced this issue and when I remove all the proxy details manually from the gradle.properties(Global Properties) file then the problem is solved. I hope this helps for someone facing the same issue.