tices
tices

Reputation: 96

How do I get Gradle to sync in Android Studio?

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:

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:

.

How do I fix this?

Upvotes: 0

Views: 1108

Answers (1)

ali ziwa
ali ziwa

Reputation: 11

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()
 }
}

Upvotes: 0

Related Questions