错误:原因:未指定 buildToolsVersion [英] Error:Cause: buildToolsVersion is not specified

查看:35
本文介绍了错误:原因:未指定 buildToolsVersion的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个简单的项目,然后右键单击该项目,然后使用make mudole app 选项.现在我有两个 build.gradle 文件夹:1- build.gradle:project My Application.2- build.gradle: Mudole 应用程序.第一个build.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()
    }
}

第二个Build.gradle文件夹如下:

 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'])
}

现在我点击 run 选项从这个项目创建 aar 文件但我收到以下错误:

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.

推荐答案

我遇到了同样的问题.我做错的是在项目的根 gradle 中放置了 apply plugin 语句.当我将它放在应用程序 gradle 中时,问题就解决了.

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.

我的建议是检查您是否在根 gradle 中放置了一些应该放置在应用程序 gradle 中的语句.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆