Gradle ADT 0.4 error: android.buildToolsVersion is missing - android

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.

Related

How to set the minimum SDK Build Tools version required in an Android Studio project?

When I try to run my React Native project in the Android emulator I get the following error:
The SDK Build Tools revision (23.0.1) is too low for project ':app'.
Minimum required is 25.0.0
My android/app/build.gradle file specifies:
buildToolsVersion "23.0.1"
On Android Studio, it also logs the same error for each of the packages I'm using:
I believe this started happening after I inadvertently updated some stuff that Android Studio suggested.
All the build.gradle files that I've checked specify version 23.0.1, but for some reason 25.0.0 seems to be overriding that setting.
How do I go about correcting this?
Ran into this issue and realized that the error is quite vague. Coming from an iOS background into React Native, I've had to learn a lot more about the Android ecosystem. The problem is that your project Gradle version is too high.
In your project's (top level) build.gradle you may be using:
classpath 'com.android.tools.build:gradle:2.3.1'
Gradle v2.3.1, implicitly sets the minimum SDK Build Tools revision to 25.0.0.
To fix, you can simply revert back to:
classpath 'com.android.tools.build:gradle:2.2.3'
This will allow your project's modules to use buildToolsVersions 23.0.1 or 25.0.2
Install required Build Tools version 25.0.0
Update buildToolsVersion in build.gradle file and sync project
Set compileSdkVersion 25 and targetSdkVersion 25
Clean and Build your project again
Finally, Run on device
Hope this will help~
May be you are updated your studio version and open your old project if you do that then you want to go to package explorer app and right click on it and open modual setting one window open then select the project and set the Gradle version
and android plugin version
example
My studio version is 2.3
then Gradle version = 3.3
and Android plugin version = 2.3.0
if you not find then create new project blank project and see the setting and apply on your project
Android SDK Build Tools are required to build Android apps (see https://developer.android.com/studio/command-line/index.html#tools-build). It's recommended to always use the latest version.
In your case react* libraries aren't compatible with current build tools version (23.0.1) so you need to upgrade (25.0.2 is the latest version at the moment).
The version is specified in build.gradle of your module. After syncing project everything would be fine or an error will be displayed that will suggest installing the missing version. Android Studio will do that for you.
android {
...
buildToolsVersion "25.0.2"
Uninstall all new-ones 'Android SDK Build-Tools' versions after comes 23.0.1 in SDK Manager and Sync and try again for that project only...

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 ;)

Gradle sync asking for nonexistent build tool version

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!

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")

Categories

Resources