Getting build-tools not installed error even though it is downloaded - android

I while building my project I am getting this error-
Error : [installPlatformSDK] build tools version 25.0.2 is not installed in SDK.
Weird thing is that this is present in my SDK.
Inside C:\xxxxxxx\AppData\Local\Android\android-sdk\build-tools, I have a folder 25.0.2 and it contains the build tools.
Now, if I change the build tools version in Gradle, from, say,
buildToolsVersion '25.0.2'
to
buildToolsVersion '25.0.1', I get this :
Failed to find Build Tools revision 25.0.1
Install Build Tools 25.0.1 and sync project
After I install build tools 25.0.1, I again get the same, first error (not found).

These are three TRICKS AND SUGGESTIONS I use when DESPERATE for Android Studio to behave:
1) Clean-->Rebuild-->Run (Clean and rebuild are options in the Build Menu);
2) invalidate cache and restart [Android Studio]
3) updating dependencies and the like. (I use build tools 27.0.3, for example, have installed new gradle plug-in, and created a wrapper using an updated version?) (see this link for more details)
4) throwing up my hands and asking someone to see if they can compile my code on their machine. In my most recent coursework, there were half a dozen times where my rig kicked out errors, but it worked for others. I ended up circling back occasionally and miraculously some errors worked themselves out.

Related

Gradle sync failed: failed to find Build Tools revision 24.0.0 rc1

As of today I've been running into an error setting up new projects in Android Studio. Right after creating a blank project the log mentions "Gradle sync failed: failed to find Build Tools revision 24.0.0 rc1."
First I looked online to see how to resolve this and came across this similar question, and followed the solution given (setting the build tools version in the module settings). However, this results in Android Studio telling me that the method "android()" cannot be found and "The project 'TestBlankApplication' may be using a version of Gradle that does not contain the method."
Additionally, the SDK Manager informs me that I have Build-tools 24 rc1 installed. So I do not know why Android Studio cannot find it.
Screencap of SDK Manager showing 24 rc1 installed:
Does anyone know how this can be resolved? Thank you.
Why you got this error:
Android studio does not come with build tools for different android versions when you download it. It also does not make sense since there are multiple versions of build tools and each of them will take hundreds of megabytes on your hard drive. This is why Android Studio installation package is 1 GB while Xcode, which has all the build tools, is 6 GB
When you choose a specific build version in the build.gradle file, your android studio may or may not have that version of build tool installed. And if not, you will see the error complaining about it.
How to fix it
You just need to install the specific version of build tool mentioned in build.gradle like this:
Click File > Settings (on a Mac, Android Studio > Preferences) to
open the Settings dialog.
Go to Appearance & Behavior > System Settings > Android SDK (Or
simply search for Android SDK on the search bar)
Go to SDK Tools tab > Check the Show Package Details check box
Select the specific version of the build tool and click on the Apply
button
After the installation, sync the project
Demos
(I choose a different version just to show you how to apply the changes by that apply button :) )
And then sync the project. The error is gone now!
Try to change the buildToolsVersion for 23.0.2
in Gradle Script build.gradle (Module App)
and set buildToolsVersion "23.0.2"
then rebuild
Follow the below procedure to solve the error.
Go to File -> Project structure.
From the drop down box, you will know all the version of build tools that are installed in your android studio.
Look for a higher version. If Gradle cannot find 24.0.0, check if 24.0.1 is present in drop down.
Do a complete code search. Find all the places where "24.0.0" is found. Replace it with "24.0.1"
Do a gradle sync.
I had same problem and eventually found out that in file build.gradle the version does not match the version of buildTools in my installed sdk.
(because I imported project done at home on different computed with updated sdk)
before:
build.gradle(app): buildToolsVersion "24.0.2"
Android\sdk\build-tools: file "25.0.1"
fixed:
build.gradle(app): buildToolsVersion "25.0.1"
Then just sync your project with gradle files and it should work.
SDK tools required build tool version installation helped me.
You just need to install required build tool version from,
SDK Manager -> SDK tool -> Show Package details -> Select required build tool version and install it.
Go to Build Gradle (Module:app)
Change the following.
In my case, I choose 25.0.3
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.cesarhcq.viisolutions"
minSdkVersion 15
targetSdkVersion 25
After that, it works fine!
Android Studio updating didn't work for me. So I updated it manually. Go to your sdk location, run SDK Manager, mark desired build tools version and install.
I ran into this problem after a fresh install of Android Studio (in GNU/Linux). I also used the installation wizard for Android SDK, and the Build Tools 28.0.3 were installed, although Android Studio tried to use 28.0.2 instead.
But the problem was not the build tools version but the license. I had not accepted the Android SDK license (the wizard does not ask for it), and Android Studio refused to use the build tools; the error message just is wrong.
In order to solve the problem, I manually accepted the license. In a terminal, I launched $ANDROID_SDK/tools/bin/sdkmanager --licenses and answered "Yes" for the SDK license. The other ones can be refused.
faced the same problem: Gradle sync failed: failed to find Build Tools revision x.x.x
reason: the build tools for that version was not down loaded properly
solution:
Click File > Settings (on a Mac, Android Studio > Preferences) to open the Settings dialog.
Go to Appearance & Behavior > System Settings > Android SDK (Or simply search for Android SDK on the search bar)
Go to SDK Tools tab > Check the Show Package Details checkbox
uncheck the specific version to remove it.
click apply.
then follow the steps 1 to 3 and 6.
Select the specific version of the build tool and click on the Apply button
After the installation, sync the project
Another thing is that all libraries from google (e.g. support lib, CardView and etc.) should have identical versions
I ran into a same problem.
I was running portable version of android studio so downloaded a package from https://developer.android.com/studio/#downloads
and installed it, and like that, done!
1) You need to change to version that is available on you studio
2) Here is how you find out version that is available for your studio
Go to File -> Project structure.
source is from #Siddarth Kanted Thanks to Siddarth Kanted.
3) And when you want to install more versions of build tool you can learn it from #Fangming user from this post.
easy working solution.

Error:failed to find Build Tools revision 23.0.0 rc2 - Android Studio

I been developing my project in my MacBook pro using Android Studio. I stored my project in a GitHub repo. But now I’m using Windows laptop so I cloned my project and try to run in Android Studio and I am getting the following error:
Error:failed to find Build Tools revision 23.0.0 rc2
Install Build Tools 23.0.0 rc2 and sync project
I clicked on
Install Build Tools 23.0.0 rc2 and sync project” but I’m getting another error:
Loading SDK information...
Ignoring unknown package filter 'build-tools-23.0.0-preview'Warning: The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.
Install Failed. Please check your network connection and try again. You may continue with creating your project, but it will not compile correctly without the missing components. (I have already checked my network connection, I’m connected to the internet using a wired connection).
When I clone my project in a Macbook everything works fine, so I'm not sure why it's not working in Windows.
Here is the screenshot:
You can use
compileSdkVersion 23
buildToolsVersion "23.0.0"
Then
Clicking the button Sync Project With Gradle Files should do the trick:
Tools -> Android -> Sync Project with Gradle Files
If that fails, try running Rebuild project:
Build -> Rebuild Project
For more details ,you can visit
AndroidStudio: Failed to sync Install build tools
AS far as your this error line concern
Error:failed to find Build Tools revision 23.0.0 rc2 Install Build
Tools 23.0.0 rc2 and sync project
It clearly says that you need to install the above mention package to build the project I mean to see the project according to new build version and techniques. So you need to update your sdk .
now come to the second error , There are couple of posibilites which I can think of
1. Make sure you are not behind any type of proxy, if so then set that proxy in your AS too.
if you have not any real issue in your network such as As I described above, then You are better to delete the folder of 23.0.0 rc2 and respective folder I mean 23XX folders. and then try launching the sdk manager again
I hope this would solve your problem , mean while if you want to see your project on different build version , please see the image below and try this
I hope this would solve your problem.
Edit 2: As I read your comment after posting this answer
You should change the build tool version in your build.gradle file in the Android studio. I think that this would work
I have changed compileSdkVersion and buildToolsVersion in gradle settings like below.It works.
compileSdkVersion 23
buildToolsVersion "23.0.0"
By
Kalaimani.R

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 Studio SDK version error after update

I just finished installing Android Studio and the JDK. Everything worked fine while I looked around the new interface. No errors or anything. After I checked for updates I went from version 0.5.2 to 0.6. When I restarted I got the error
Error:The SDK Build Tools revision (19.0.3) is too low for project ':app'. Minimum required is 19.1.0
Which SDK is it referring to and shouldn't it update along with Android Studio? Before I updated I did not have this message.
So Android Studio version 0.6 requires the Android SDK build tools to be 19.1 instead of the old 19.0.3.
To install this, follow these steps:
Close all open projects.
On the main Android Studio window, press Configure
Then click SDK Manager
Once inside find the following build tools version:
Then tick the box and install the package.
Once your done with that, close the SDK Manager, restart Android Studio, and you should be good to go!
EDIT:
One more thing you need to do:
Open your project.
Navigate to your build.gradle file located inside your module. For you, I think it's in the app folder.
Open the file.
Now you should see something like this:
Where it says buildToolsVersion in the quotes, replace 19.0.3 with 19.1.0. Now sync gradle files and everything should be solved.

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