网上找了很多方法,但是感觉都不太对
最后自己找到了一个解决方法
在android Studio中Android展示项目结构
然后打开你项目名称对应的build.gradle
把以下代码复制进去(如果找不到这个文件,就是用Project Files结构打开,在项目名称对应下的文件夹下面添加build.gradle这个文件,把以下代码复制进去)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
// 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
}