Few users are complaining that after upgrading their Grandle Plugin they are facing an error with the error message: 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 in Android Gradle.
If you are also facing such type of error then this post will definitely be going to beneficial to you, here we are going to discuss all possible solutions, so let’s begin with this guide.
Recently I have Just Upgraded my Gradle Plugin but now I am not able to construct It, it is giving the accompanying mistake:
Plugin [id: ‘com.android.application’, version: ‘7.1.3’, apply: false] was not found in any of the following sources:
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
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 Google MavenRepo
So here we going to explain a few possible solutions in detail and try to resolve this error.
To fixing the error: 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 Error. As Error is recommending that variant/version 7.1.3 not saw as in any of the sources so we simply need to change the following plugin version in build.gradle file and Android Gradle Plugin 7.1.3 have been delivered/ released. So First of all open your build.gradle file and afterward find modules and change their variant as given beneath: modules { id ‘com.android.application’ version ‘7.1.2’ apply false id ‘com.android.library’ version ‘7.1.2’ apply false } Now, attempt to remake your project and your blunder should be addressed at this point. Much thanks to You.
Solution:
As Error is proposing that version 7.1.3 is not viewed as in any of the following sources so we simply need to change the following version in build.gradle record and Android Gradle Plugin 7.1.3 have been delivered. So First of all open your build.gradle record and afterward find plugins and change their version as given underneath.
plugins {
id 'com.android.application' version '7.1.2' apply false
id 'com.android.library' version '7.1.2' apply false
}
I Hope, try to rebuild your project again and hope your error is get solved now.
Must Read:
It seems like you’re encountering an issue with Gradle while trying to apply the Android application plugin. Here’s a solution:
- Check Plugin ID and Version: Verify that the plugin ID (
com.android.application
) and version (7.1.3
) are correct. It’s possible that there might be a typo or the version you specified isn’t available. - Plugin Repository: Ensure that the repository containing the Android plugin is included in your Gradle build script. Typically, for Android projects, the Google Maven repository is required. You can add it to your
build.gradle
file like this:repositories { google() // other repositories if needed }
- Internet Connection: If you’re behind a proxy or firewall, ensure that your Gradle build can access the internet to download the required plugin dependencies.
- Gradle Version Compatibility: Check if the Gradle version you’re using is compatible with the Android plugin version you’re trying to apply. Sometimes, certain plugin versions require specific Gradle versions.
- Cache Cleanup: Gradle caches may sometimes cause issues. Try cleaning the Gradle cache by running
./gradlew clean
in your project’s root directory. - Update Gradle and Android Plugin: Ensure you’re using the latest Gradle version and the Android plugin. Gradle and the Android plugin are frequently updated with bug fixes and improvements.
- Debugging: If the issue persists, try running Gradle with the
--debug
flag (./gradlew clean assembleDebug --debug
) to get more detailed information about the failure. This can help pinpoint the exact cause of the problem.
By following these steps, you should be able to resolve the UnknownPluginException
and successfully apply the Android application plugin in your Gradle project.
Conclusion on Gradle
In conclusion, the org.Gradle.API.plugins.UnknownPluginException
suggests that Gradle was unable to locate the specified Android application plugin with ID com.android.application
and version 7.1.3
. This issue could arise due to various factors such as incorrect plugin configuration, repository misconfiguration, or compatibility issues between Gradle and the plugin version. By carefully reviewing and adjusting the plugin configuration, ensuring the appropriate repositories are included, and verifying compatibility, this exception can typically be resolved, allowing the Gradle build to proceed successfully.