报错为:Error:(9, 0) Cannot get property 'compileSdkVersion' on extra properties extension as it does not exist
<a href="openFile:D:\zyl\projects\7 doing\DroidPluginDemo\DroidPlugin\build.gradle">Open File</a>
解决方法:在Buid.gradle(project:XXX) 中根目录添加
buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } //添加此处 解决rootProject.ext.compileSdkVersion 不存在的问题 ext { compileSdkVersion = 26 buildToolsVersion = "25.0.3" minSdkVersion = 15 targetSdkVersion = 26 }