网上查看了很多,还是半天没有解决我的问题。
今天升级了studio版本。旧版本的项目运行,编译不通过。然后就是标题的错误。最开始 clear,bulid啊都不行。
好记性不如烂笔头。记录下整个过程,希望帮助同样问题的码农们。
切入正题:
1)把Project和app目录下面的 build文件删除!
2)找到Project目录下面的build.gradle文件。
dependencies {
classpath 'com.android.toolgs.build:gradle:3.2.0-alpha12' --->这是改成当前studio最新版本的gradle版本
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
3) Rebuild project