Plugin with id 'com.android.application' not found解决方案

导入了一个老包,发现报错

 Error:(1, 0) Plugin with id 'com.android.application' not found

想到肯定是因为构建成android  studio的项目没成功而造成的,于是对比了下现有的项目,发现

project 即项目中的gradle文件缺少了点东西 

Plugin with id 'com.android.application' not found解决方案

buildscript {
    
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}


把这写东西放到project即可,重新构建解决问题~