Environment:
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
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. . .