【Android】导入项目后出现Plugin with id ‘
2023-07-09 本文已影响0人
hao_developer
【Android】导入项目后出现Plugin with id ‘com.android.application’ not found.
原因:gradle还缺少配置;
如图:
![](https://img.haomeiwen.com/i1722765/c17243f8c9eabf34.png)
解决方法:将以下代码放在build.gradle中,粘贴到最外层即可
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'//版本可更改
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
再次编译即可成功运行