skip to Main Content

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


  1. if your project is open in android studio, follow these simple steps as seen in the below screenshot

    1. click on the project tab at the top – left of your android studio app.

    2. Down your project structure, click on Gradle Scripts. In the drop down, you will see two build.gradle files

    3. Open the build.gradle with (Module:Application_Name.app)

    4. Inside the build.gradle file opened, make sure the it contains the following at the top.

      plugins { id ‘com.android.application’}

    5. Then build your application.

    if you still receive this error, then open the other build.gradle file with (Project:Application_Name)

    1. 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

      }

    2. 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

    Login or Signup to reply.
  2. Can you try this

    1. Go to ‘File’
    2. Click on ‘Sync Project with Gradle files’
    3. Make sure you have internet connected
    Login or Signup to reply.
  3. There are a number of basic steps when you get this type of error

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

    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.

    enter image description here

    2- Go to "File -> Setting -> (settings cogwheel) -> Http Proxy Setting" and check which proxy setting you are using.

    enter image description here

    enter image description here

    I hope this solves your problem with Gradle.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search