Gradle sync asking for nonexistent build tool version - android

Failed to sync Gradle project
Error: failed to find Build Tools revision 24.1.2
However, Build Tools revision 24.1.2 does not exist. Before this error came up, Gradle was giving an error that it required android-19, even though the build.gradle file clearly specifies android-21. This was fixed by installing android-19.
However, because revision 24.1.2 does not exist for Build Tools, it cannot be worked around by simply installing this version. The build.gradle file specifies version 22.0.1, but it seems to be completely ignored. I also tried changing it from the app properties window but it still failed to compile.
What may be causing this is the fact that some of the code was developed on another computer, and slight differences are causing gradle to require incorrect version numbers.
How can this problem be fixed?

You should just open Android SDK Manager. It is the app where you install Android SDK and other helper apps.
When it is refreshed you should see there is Build Tools version 24.1.2 at the top. You should install that.
I've just checked and 24.1.2 is installed on my machine.

In android studio go to
Tool => Android => SDK Manager and update your build tools.
Check if it is installed ?

You may have a gradle configuration problem. Can you post your gradle config?
At the time of writing, the latest Android SDK Build Tools version is 22.0.1 and the latest Android SDK Tools version is 24.1.2.
This would be an example of a gradle config targeting the latest versions (no need to specify the SDK tools version):
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
...
Latest release notes can be found here:
Android SDK Build Tools:
https://developer.android.com/tools/revisions/build-tools.html
Android SDK Tools:
https://developer.android.com/tools/sdk/tools-notes.html
I hope this helps!

Related

Failed to find Build Tools revision 23.0.1

I am trying to build my first app with react-native.
I am following these 2 tutorial:
https://facebook.github.io/react-native/docs/getting-started.html#content
https://facebook.github.io/react-native/docs/android-setup.html
I am sure that I installed all the requirements from the second link but when I try running my app with react-native run-android, I get the following error:
I executed this command while running genymotion.
This is all that I have installed in Android SDK:
I tried to install Android build tools 23.0.1 but I get this error:
What should I do?
You should install Android SDK Build Tools 23.0.1 via Android SDK. Don't forget to check Show Packages Details.
I faced the same problem and I solved it doing the following:
Go to /home/[USER]/Android/Sdk/tools
and execute:
$android list sdk -a
Which will show a list like:
Android SDK Tools, revision 24.0.2
Android SDK Platform-tools, revision 23.0.2
Android SDK Platform-tools, revision 23.0.1
... and many more
Then, execute the command (attention! at your computer the third option may be different):
$android update sdk -a -u -t 3
It will install the 23.0.1 SDK Platform-tools components.
Try to build your project again.
Either install v23.0.1 of the build tools (the fifth row in your screenshot), or change your code to use the build tools version you already have installed (v23.0.3). This can be specified in your app's build.gradle file:
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
...
}
}
As per duncanc4's comment below,
The build.gradle file you want to edit is in the android/app folder
within your project directory.
The error you're getting seems to be related to system's permissions, since it's not able to create a folder.
Try running the sdk-manager using root (with su or sudo commands).
I had this error:
Failed to find Build Tools revision 23.0.2
When you got updated/installed:
Android SDK Build Tools
Android SDK Tools
Change version number in build.gradle
FROM
buildToolsVersion "23.0.2"
TO
buildToolsVersion "25.0.2"
How to find what Build Tools version you have
Check your $ANDROID_HOME, sometimes is /usr/local/opt/android, but it's not your install sdk path, change it and fix this problem
Nothing helped until I found this solution : https://stackoverflow.com/a/39068538/3995091
In Android SDK, the build tools with the correct version where shown as installed, but still I got the same error saying they couldn't be found. When I used the above solution, I found out they were indeed not installed, although Android SDK thought they were. Installing them solved it for me.
While running react-native In case you have installed 23.0.3 and it is asking for 23.0.1 simply in your application project directory. Open anroid/app/build.gradle and change buildToolsVersion "23.0.3"
In the Gradle Console (link available in the window bottom right), you have two tabs: the error is shown in Gradle Build tab. Click on the Gradle Sync tab, then click on the Install Build Tools XX.X.X and sync project link. This will download the build version required by your project.
You may also change your project SDK version but you don't always have this option if it is imposed.
If you already install the correct Android SDK Platform-Tools (Build Tool) and you still get an error, try to invalidate the cache; File -> Invalidate caches / Restart....
On my system, Android SDK Manager showed /usr/local/Cellar/android-sdk as the SDK path, when $ANDROID_HOME was /Users/james/Library/Android/sdk. I just added a symlink for the correct build tools version.
Two solutions: You have to instal the required buildToolVersion or set it as described above.
Notice that if you are trying to set the buildToolsVersion "23.0.3" using Android Studio 3.0 or more it won't work until you remove all builversion you have keeping just one last version you use.
I read this somewhere else and this works for me.
Hope this helps.
As the error says
Failed to find build Tools revision 23.0.1
This means that in your project you have used
buildToolsVersion "23.0.3"
So,You need to download the exact same version this makes the error disappear
**Step 1:**
GO to Tools and click SDK Manager
**Step 2:**
you can see SDK Platforms ,SDK Tools and SDK update Sites
**Step3:**
Click SDK Tools and click show package details
**Step 4:**
Select the version that you have mentioned in your Project
These Steps has solved my issue.
If anyone can't build their downloaded source code (probably google codelabs source code) with Android Studio, try simply remove the buildToolsVersion from the build.gradle file, and Android Studio will build the project with it's default latest buildToolVersion
¯_(ツ)_/¯
Each version of the Android Gradle Plugin now has a default version of the build tools.
So, probably you specified build tool version explicitly in the build file.
Just remove buildToolsVersion = "x.y.z" from your build.gradle script.
If, for some reason, you need that specific revision, follow the other answer.
Just install it from Android Studio ;)

Android Studio not recognizing SDKs

I have updated my Android Studio to Beta 0.8.6 but now am not able to build because I cannot seem to get the sdks working correctly. I have checked my path and it is pointing to the correct place and even tried it with different paths. But everytime I try to build I get the same error. I did have to replace my Android Studio to get the beta version but kept my preferences from my previous version.
Failed to sync Gradle project 'OlleyVotto'
Error:Error:The SDK Build Tools revision (19.0.0) is too low for project ':app:libraries:volley'. Minimum required is 19.1.0
install.build.tools">Install Build Tools 19.1.0, update version in build file and sync project.
I have installed the build tools and followed this direct link but keep getting the same error.
Update buildToolsVersion in build.gradle, like
buildToolsVersion '19.1.0'
And you may need to update your build tools in SDK Manager.

Android-Jenkins: failed to find Build Tools revision 17.0.0 On Jenkins Build Server

I'm trying to use the Android Emulator on Jenkins to build and test my project. But I'm getting an the following error when running my gradle tasks;
failed to find Build Tools revision 17.0.0
the gradle task I'm running is;
./gradlew clean connectedCheck
in my gradle build file I has the following configuration
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 17
}
}
The build server is a headless Ubuntu instance (12 something). My first thought was that I didn't have the correct build tools installed so I had a look in my android-sdk/build-tools director. All I could see was a directory called 18.1.1. So I thought if I updated my android sdk it would download version 17.0.0. So I ran the following command:
android update sdk --no-ui
and it seems to download various many things but looking in the build tools directory again I still only see version 18.1.1.
So questions are:
1) Am I right in assuming the build is failing because I don't have the correct build tools revision in my android sdk directory? (/android-sdk/build-tools)
2) How do I update the build-tools on a headless server so that I have version 17.0.0?
If you need me to provide more information, please let me know.
Thanks in advance for you help.
By default, android update sdk (or android list sdk --extended) only lists the packages which aren't considered deprecated.
As Build Tools 17.0.0 is a comparatively old version, it won't be shown by default.
Running with the -a (--all) flag will get you the older versions, e.g.:
android update sdk -u -a -t build-tools-17.0.0
At some point in the future the Jenkins plugin should automatically install the correct build tools for you, based on your build.gradle file.
Edit (Nov 2015): This functionality probably will not be added to the Android Emulator plugin.
Nowadays I would recommend using the android-sdk-manager Gradle plugin, which automates the installation of all prerequisites for a Jenkins build, including Android SDK, tools, build-tools, platforms, support libraries etc.
This can be very easily integrated into your project, and removes the need to keep the Android SDK installation on your Jenkins build machines up-to-date.
Other way to do it, is manually update for the missing version using Android SDK Manager attached to Jenkins (Look for Configuration: ANDROID_SDK, then under it access "tools/android.sh")

Import of Eclipse project into Android Studio using build.gradle file fails

I'm trying to import my Eclipse based Android project using the build.gradle file. I get the following message: "failed to find Build Tools revision 18.0.0". However, according to the Android SDK Manager, I have Android SDK Build-tools 18.0.1 installed.
I am doing all this on a 64-bit Windows 7 machine, if that's relevant.
How do I fix this?
UPDATE: I actually only updated to Build-tools 18.0.1 this morning. I then noticed that, when making a new project in Android Studio, it wouldn't allow me to create a project using Android 4.3 (4.2.2 was the latest allowable version). I tried dropping the target version of my project to Android 4.2.2, and re-exporting it. Now Android Studio complains about not being able to find Build-tools 18.0.1 when I try to import this project.
I was an Android Studio virgin too up until 10 minutes ago. I ran into the same problem. If you check your SDK Manager in Android Studio (or Eclipse I believe) it will show which tools you have installed. I am/was missing build tools 18.0.1 too and getting the error....but it was because I hadn't installed them.
So without modifying the Gradle build files, I was able to install the build tools using the SDK Manager and get everything up and running.
See this image:
As an aside, I also had to update the API version as well because it selected an API version that wasn't installed (which I don't get because it was when I compiled with Eclipse).
Hope this helps.
This did the trick for me.
In build.gradle file inside the main module modify the line
buildToolsVersion "18.0.0"
to
buildToolsVersion "18.0.1"
I'm very new to Android Studio (as of last night). I encountered the same problem. I opened up the 'build.gradle' file and modified the lines with: "compileSdkVersion 18" and "buildToolsVersion 18.0.1" to 17 and 17.0.0 respectively. It seems to do the trick!
you must make sure the build.gradle file contains the same version of the installed build tools.
you can find this out by looking in the /sdk/build-tools/android-X.Y.Z/source.properties file under the Android Studio installation
e.g.
Pkg.UserSrc=false
Pkg.Revision=18.1.1
then plug that revision number into the gradle build file:
android {
compileSdkVersion 18
buildToolsVersion "18.1.1"
...
}
I had issues with Gradle too. A full delete and install the latest version fixed it.
I also had the same problem then I have checked my Enviornment Variable and it is pointing to my old sdk which does not have Build tool 18.0.x After pointing it to new sdk everything goes well.

Gradle ADT 0.4 error: android.buildToolsVersion is missing

Attempting to build my Android project using the latest ADT tools release of Gradle, I get the following error:
Execution failed for task ':compileDebugAidl'.
> android.buildToolsVersion is missing!
Using Gradle 1.6, Android plugin 0.4.
Make sure that you've downloaded the latest ADT, SDK, Platform and Build tools. Then add this to your gradle build.
android {
buildToolsVersion "17.0"
compileSdkVersion 15
}
credit to the adt mailing group.
Note: It is important to put the " around the 17.0 as shown - otherwise that will not work
The buildToolsVersion value depends upon which version you downloaded from Google.
Assuming you installed the Android SDK, run "android" from the command-line, to open the Android SDK Manager. In the left column you'll see Tools | Android SDK Build-tools. That tells you whether or not you've installed the Build-tools yet.
After installing the Build-tools, look at the second column, labelled "Rev." It has the Build-tools version to use for gradle's buildToolVersion.

Categories

Resources