【AS坑】Plugin [id: ‘com.android.application‘] was not found in any of the following sources解决

Environment:
Insert image description here
I have no problem running projects before. I started to learn kotlin and wanted to write a demo. When I created a new project, sync could not be started and the error shown in the title was reported.

View Event Log
Insert image description here

Preliminary attempt
to add in both internal and external build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:/*你自己的gradle版本*/'
    }
}

The problem is not resolved at this time


The plugins item of build.gradle in the app directory where the disease is located does not have a specific version. The initial code is as follows:

plugins {
    id 'com.android.application' 
    id 'org.jetbrains.kotlin.android' 
}

After changes:

plugins {
    id 'com.android.application' version '7.2.1'
    id 'org.jetbrains.kotlin.android' version '1.6.10'
}

solve.
It's strange that the configuration file automatically generated by Android studio is still lacking. . .

Guess you like

Origin blog.csdn.net/weixin_40934065/article/details/125001417