【发布时间】:2017-12-27 16:19:08
【问题描述】:
我无法理解是什么问题?谁能帮忙,附上Android Studio的截图
构建等级文件是 // 顶级构建文件,您可以在其中添加所有子项目/模块通用的配置选项。
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
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我的 app build.gradle 文件是
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.a479729.myapplication"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
【问题讨论】:
-
发布你的 build.gradle 文件
-
我已附上截图
-
// 顶级构建文件,您可以在其中添加所有子项目/模块通用的配置选项。 buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' // 注意:不要将应用程序依赖项放在这里;它们属于 // 在单个模块 build.gradle 文件中 } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }
-
不是顶级 gradle post app build.gradle.
-
不是一个,发布所有依赖项都写入的应用程序级别的 gradle 文件。在应用文件夹中找到它
标签: android android-gradle-plugin