0

I can't test any of my code. I've tried different solutions, and none of them has worked for me. This is the error I get:

.

Build file 'C:\Users\tices\AndroidStudioProjects\HelloWorld\build.gradle' line: 3

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

  • Try: Run with the --info or --debug option to get more log output. Run with --scan to get full insights.

The 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 the '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
    • Google
    • MavenRepo <152 Internal Lines>

.

How do I fix this?

tices
  • 96
  • 9

1 Answers1

0

I believe with the new gradle structure, the repositories are in the settings.gradle file.

Have you tried to make sure that in your settings.gradle file, you have google() repository.

Something like this:

pluginManagement {
 repositories {
    gradlePluginPortal()
    google()
    mavenCentral()
 }
}
ali ziwa
  • 11
  • 4
  • What is the settings.gradle file? How do I get to it? – tices Apr 08 '22 at 18:21
  • If you are using Android studio as your IDE, the quickest way is through the menu bar. `Navigate -> Search Everywhere` then search for `settings.gradle` file. – ali ziwa Apr 09 '22 at 06:51
  • It ended up syncing itself. All I had to do was click on a "sync gradle" link – tices Apr 10 '22 at 11:56