Error:Cause: buildToolsVersion is not specified

前端 未结 12 2266
慢半拍i
慢半拍i 2020-12-24 00:50

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-

相关标签:
12条回答
  • 2020-12-24 00:57

    for me it was an additional classpath line for example :

    classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
    classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
    

    so i was deleting the first

    classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
    

    and the issue solved

    0 讨论(0)
  • 2020-12-24 01:00

    Try to invalidate caches / restart , it fixed this like this after updated File-> Invalidate caches/restart

    0 讨论(0)
  • 2020-12-24 01:01

    Add buildToolsVersion property to your local build.gradle file.

    android {
        compileSdkVersion 27
        buildToolsVersion "26.0.1"
    
        defaultConfig {
            targetSdkVersion 27
        }
    }
    

    As per your requirements!! Then Try to build -> you will get build failure and this message :

    Failed to find Build Tools revision 26.0.1

    Install Build Tools 26.0.1 and sync project

    Then Click to Install build tools and your project is configured and you are good to go!!!

    0 讨论(0)
  • 2020-12-24 01:03

    I had same error, I using cordova and resolve by removing the space character

    id="com.xx.yy " => to id="com.xx.yy"

    0 讨论(0)
  • 2020-12-24 01:04

    Might be helpful for someone: in my case long time ago I had added keystore properties in build.gradle file for Android:

    def keystorePropertiesFile = rootProject.file("keystore.properties")
    def keystoreProperties = new Properties()
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
    

    and after some period of time I pulled repo and forgot to add this file ("keystore.properties").

    Gradle for some reason (!) gave me the same error (buildToolsVersion was defined a bit below in build.gradle file). The workaround was just to add missing "keystore.properties" file.

    0 讨论(0)
  • 2020-12-24 01:06

    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.

    0 讨论(0)
提交回复
热议问题