Gradle sync failed: Cause: failed to find target with hash string 'android-18' in: C:\Users\Android\sdk Consult IDE log for more details
I am finding this error every time, when importing a project into android studio.
Go into the Android SDK manager and install the platform SDK for API 18. Or, go into the project settings and change the target API and build tools versions to be what you already have installed.
I am finding this error every time, when importing a project into android studio.
For addressing this issue, you may want to change SDK level of the imported project to whatever you'd like. (However you should mak sure your chosen SDK level meets features used by the library)
For this, you should open build.gradle file of that project and change SDK level there.
defaultConfig {
minSdkVersion 4
targetSdkVersion /* SDK LEVEL */
}
Another option would be installing SDK level 18 via SDK manager.
For handling this issue, you have to update the gradle version in build.gradle of your project to latest gradle version of your android studio. After that if android studio terminal shows any of the following then
1) install the missing platform(s)
or
2) install build tools
or
3) Fix Gradle wrapper and re-import project
do that and sync your project.
Related
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...
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.
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
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.
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.