Failed to create Android tool version

I tried to open an old project in a recently installed Android studio (today), it gave me this error:

failed to find build tools revision 23.0.0 rc2
install build tools 23.0.0 rc2 and sync project

I searched it online and I tried adding it to the gradle file:

android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
}

And that gave me another error:

gradle DSL method not found: 'android()'
possible causes:
the project may be using a version of gradle that does not contain the method.
gradle settings.
the build file may be missing a gradle plugin.
apply gradle plugin.

this is my gradle file:

// 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:1.2.3'
  }
}

allprojects {
repositories {
    jcenter()
  }
}
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
}
+4
source share
6 answers

Right-click on your project> Open Module Settings> Properties tab, and then change:

Compile Sdk Verion to API 23: Android 6.0
Build Tools Version 23.0.0

enter image description here

+4
source

, Android-, Android SDK Build-Tools rc3, rc2. build.gradle( ) android {   compileSdkVersion 22   buildToolsVersion "23.0.0 rc3" } . , .

+2

build.gradle android

android {
   compileSdkVersion 22
   buildToolsVersion "22.0.0"
}

:

    // 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:1.2.3'
       }
    }

    allprojects {
       repositories {
         jcenter()
       }
    }

android app/build.gradle, - :

apply plugin: 'com.android.application'

android {
    compileSdkVersion XX
    buildToolsVersion "XX.X.X"

    defaultConfig {
       minSdkVersion XX
       targetSdkVersion XX
       versionCode 1
       versionName "1.0"
    } 
    buildTypes {
      release {
         //......
      }
    }
}
dependencies {
  //......
}
+1

theres 2 gradle

, , /APP/BUILD.GRADLE

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "PUT THE CODE YOU WANT HERE EX "23.0.0 r3""

    defaultConfig {
        applicationId "org.app.appname"
        minSdkVersion 10
        targetSdkVersion 22
        versionCode 9
        versionName "1.10.3"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.google.android.gms:play-services:7.5.0'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:support-v4:22.2.1'
    compile files('libs/volley.jar')
}

,

// 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:1.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
0

, , ,

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0 rc2"
}

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0" //DELETE rc2 AND SYNC PROJECT 
}
0
source

Depending on which version of the Android SDK Build-tools you installed, you can check it through the SDK Manager, in my case I do not have 23.0.0 rc2, but 23.0.1, so you need to edit your app/build.gradle

for me it was then:

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.1"
}
0
source

Source: https://habr.com/ru/post/1598454/


All Articles