1

I'm getting the error:

WARN - ect.sync.idea.ProjectSetUpTask - Failed to find Build Tools revision 26.0.2

It is actually an error breaking my build but this wasn't copyable so I found this line in the log (the only place I could find reference to "26.0.2"

I've searched (Ctrl-Shift-F) for 26.0.2 everywhere and found just 2 occurrences of 26 in one file, the "app" level build.gradle:

android {
    compileSdkVersion 26
    defaultConfig {
        targetSdkVersion 26
...

Which I changed to 27, my build tools is 27.0.3 which I use for other projects, I don't want another build tools. How can I communicate this to Android Studio?

failed to install build-tools

John
  • 6,433
  • 7
  • 47
  • 82
  • Possible duplicate of [Gradle sync failed: failed to find Build Tools revision 24.0.0 rc1](https://stackoverflow.com/questions/36019599/gradle-sync-failed-failed-to-find-build-tools-revision-24-0-0-rc1) –  May 10 '18 at 20:54
  • @Eminem, I linked that in my answer, it is not a duplicate, this is far more specific – John May 10 '18 at 20:58
  • you can add an answer there,so that people can see it –  May 10 '18 at 21:01
  • Check https://stackoverflow.com/questions/46999419/android-studio-3-0-buildtoolsversion-not-found-in-gradle-files – Gabriele Mariotti May 10 '18 at 21:06
  • @Eminem, the answer was found there, only after asking here – John May 10 '18 at 21:15

1 Answers1

0

Credit to https://stackoverflow.com/a/47425748/866333, I hope this offers easier sign posting:

android {
    compileSdkVersion 27
    // Add the following line, Android Studio is quite good for filtering bloat.
    buildToolsVersion "27.0.3"
    defaultConfig {
        targetSdkVersion 27
        ...

I actually had to add a line, so I don't know where AS was reading 26.0.2 from, but this fix has worked on 2 of my projects. Oh, and because I'm now using the support lib (because its 2018):

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.android.support:design:26.1.0'

will be on the wrong versions, fix by replacing the 3 occurrences of "26.1.0" with, eg, "27.1.1", as that was what the error messages was hinting at.

John
  • 6,433
  • 7
  • 47
  • 82
  • I am undeleting this answer because it is still the first one I find when I get this error. – John Jun 27 '18 at 20:28