So i just wanted to creat a hello world app and this happened
Build file ‘C:UsersYunessAndroidStudioProjectsMyApplication2build.gradle’ line: 3
Plugin [id: ‘com.android.application’, version: ‘7.1.2’, 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.2’, 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.2’) Searched in the following repositories: Gradle Central Plugin Repository Google MavenRepo
3
Answers
if your project is open in android studio, follow these simple steps as seen in the below screenshot
click on the project tab at the top – left of your android studio app.
Down your project structure, click on Gradle Scripts. In the drop down, you will see two build.gradle files
Open the build.gradle with (Module:Application_Name.app)
Inside the build.gradle file opened, make sure the it contains the following at the top.
plugins { id ‘com.android.application’}
Then build your application.
if you still receive this error, then open the other build.gradle file with (Project:Application_Name)
check for plugin section and paste this below
plugins {
id ‘com.android.application’ version ‘7.1.2’ apply false
id ‘com.android.library’ version ‘7.1.2’ apply false
}
Build your application.
if you dont find any of these file, it means you need to create the build.gradle. but as a beginner, is better to delete the project and create it again.
please make sure your internet is active to sync your gradle
gradle
Can you try this
There are a number of basic steps when you get this type of error
1 – You have to check if Gradle is working in offline mode and the solution is in the right side menu "Click Toggle Offline Mode" if it is active.
2- Go to "File -> Setting -> (settings cogwheel) -> Http Proxy Setting" and check which proxy setting you are using.
I hope this solves your problem with Gradle.