没有指定buildToolsVersion是:错误:原因 [英] Error:Cause: buildToolsVersion is not specified
问题描述
我创建了一个简单的项目,然后我在项目上单击右键,然后我使用使mudole应用
选项。现在我有两个的build.gradle
文件夹:1 的build.gradle:项目在我的应用
。 2 - 的build.gradle:Mudole应用
。第一个的build.gradle
如下:
//顶级构建文件,您可以添加常用的配置选项,所有分项目/模块。
应用插件:'com.android.library
buildscript {
库{
jcenter()
}
依赖{
类路径'com.android.tools.build:gradle:1.3.0 //注意:不要在这里把你的应用程序依赖关系;他们属于
//在单个模块的build.gradle文件
}
}allprojects {
库{
jcenter()
}
}
和第二的build.gradle
文件夹如下:
应用插件:'com.android.application
安卓{
compileSdkVersion 23
buildToolsVersion23.0.0 defaultConfig {
的applicationIDcom.exam.exam.myapplication
7的minSdkVersion
targetSdkVersion 23
版本code 1
的versionName1.0
}
buildTypes {
发布 {
minifyEnabled假
proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard-rules.pro
}
}
}依赖{
编译文件树(导演:'库',包括:['的* .jar'])
}
现在我点击运行
选项来创建 AAR
从这个项目的文件,但我得到以下错误
错误:原因:未指定buildToolsVersion的。
我有同样的问题。我在做什么错在项目的gradle根应用插件声明的摆放。当我把它放在应用程序,然后gradle这个问题得到了解决。我的建议是检查,如果你把一些声明根gradle这个,你应该在应用程序中进行的gradle放置。
I create a simple project and then I right-click on the project and then I use the make mudole app
option. Now I have two build.gradle
folders: 1- build.gradle:project My Application
. 2- build.gradle: Mudole app
. the first build.gradle
is as follows:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'com.android.library'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
And the second Build.gradle
folder is as follows:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.exam.exam.myapplication"
minSdkVersion 7
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
And now I click on the run
option to create aar
file from this project But I get the following error:
Error:Cause: buildToolsVersion is not specified.
I had the same issue. What I was doing wrong was the placing of apply plugin statement in the root gradle of the project. When i placed it in the app gradle then the issue got resolved. What I would suggest is to check if you are placing some statement in the root gradle that you should be placing in the app gradle.
这篇关于没有指定buildToolsVersion是:错误:原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!