I have Android Studio 2.2. I am trying to open a project, but I get the error "Failed to find target with hash string 'android-25'". Below the error message I see a link "Install missing platform(s) and sync project". If I click this link, I get another error, which says
"The following packages are not available: - Package id
platforms;android-25".
In the Android SDK tool, I can see "Android 7.0" (API level 24) already installed. On checking the details about Android verisons and its API levels, I found that Android Nougat has API levels 24-25. I would like to know how I can update the SDK from API24 to 25?
You don't need to update anything. Just download the SDK for API 25 from Android SDK Manager or by launching Android standalone SDK manager. The error is for missing platform and not for missing tool.
Well, I was suffering with this Issue but finally I found the solution.
Problem Starts Here:
["Install missing platform(s) and sync project" (link) doesn't work & gradle sync failed]
Problem Source: Just check out the app -> src-build.gradle and you will find the parameters
compileSdkVersion 25
buildToolsVersion "25.0.1"
targetSdkVersion 25
Note: You might find these parameters with different values e.g
compileSdkVersion 23 etc.
These above parameters in build.gradle creates error because their values are not compatible with your current SDK version.
The solution to This error is simple, just open a new project in your Android Studio, In that new project goto app -> src-build.gradle.
In build.gradle file of new project find these parameters:
In my case these are:
compileSdkVersion "26"
buildToolsVersion "26.0.1"
targetSdkVersion 26
Now copy these parameters from your new project build.gradle file and post them in the same file of the other project(having Error).
I got similar problem
1: I tried to resolve with the answer which is marked correct above But I was not able to get the system setting which was quit amazing (On MacBook).
Most of the time such errors & issues comes because of replacing your grade file with other grade file ,due which gradel does not sync properly and while building the project issue comes . The issue is bascially related to non syncing for platform tools
Solution a: Go to File and then to Your project strucutre -modules -app-Properties -build tool version -click on options which is required for your project (if required build tool version not there chose any other). This will sync the grade file and now you can go to gradel and change target version and build tool version as per your requirement .you will prompted to download the required platform tool to sync it , now click on install tool version and let project to build
Solution b: Try Anuja Ans if you can get option of system setting and install platform tool.
Make sure your computer is connected to the internet, then click on the link that comes with the error message i.e "install missing platform(s) and sync project". Give it a few seconds especially if your computer has low specs, it will bring up a window called SDK Quickfix Installation and everything is straightforward from there.
I got same exception while running gradle build for my android project.
Caused by: java.lang.IllegalStateException: Failed to find target with hash string 'android-27'
This issue related to android SDK version enable for your Android Studio.
Please find the solution of this problem from attached screen.
You can open the SDK standalone by going to installation directory, just right click on the SDK Manager.exe and click on run as Administrator. i hope it will help.
the default gradle version 3.3 may have some bugs, I switched to gradle 3.5 and everything got ok
I have got same error for Android-28. In SDK manager - SDK Platform it shows me that Android API 28 is partially installed and no further updates available. so that I updated ANDROID-SDK-BUILD-TOOLS from SDK Tools and after restarting project. It will work. This might be helpful for other who faces same issue as I faced.
It seems like that it is only me who are so clumsy, because i have yet to found a solution that my case required.
I am developing a multi-modular project, thus base android module configuration is extracted in single gradle script. All the concrete versions of sdks/libs are also extracted in a script.
A script containing versions looked like this:
...
ext.androidVersions = [
compile_sdk_version : '27',
min_sdk_version : '19',
target_sdk_version : '27',
build_tool_version : '27.0.3',
application_id : 'com.test.test',
]
...
Not accustomed to groovy syntax my eye has not spotted that the values for compile, min and target sdks were not integers but STRINGS! Therefore a compiler rightfully complained about not being able to find an sdk a version of which would match HASH STRING '27'.
So the solution would be to make sdk's versions integers:
...
ext.androidVersions = [
compile_sdk_version : 27,
min_sdk_version : 19,
target_sdk_version : 27,
build_tool_version : '27.0.3',
application_id : 'com.test.test',
]
...
I had similar issue for android-29. My issue occurred because when AS was unzipping one downloaded SDK I had stopped it. For solving the issue disable gradle offline mode then sync with gradle files. You may need to set proxy and enable it.
I just downloaded android studio and it wouldn't download I keep getting
Error: Failed to find target with hash string 'android-24'.
please help me, if you have an idea because I cannot do anything and its annoying.
click 'install missing platforms'
or
modify the build.gradle file and change buildToolsVersion to whatever version you have.
In build.gradle file change build tools version to the latest SDK version numbers.
After upgrading gradle of my project (and library attached to it) from 2.1.3 -> 2.2.0 it doesn't build anymore and it says:
Error:Execution failed for task ':app:transformNative_libsWithStripDebugSymbolForDebug'.
java.lang.NullPointerException (no error message)
Anyone have a clue on why this is?
I found answer here:
https://stackoverflow.com/a/40117446/1088975
The point is to set both targetSdkVersion and compileSdkVersion to 22"
You need to change the following lines in build.gradle file:
android {
// SDK 24 worked for me - make sure you have the latest and update it accordingly.
compileSdkVersion 24
buildToolsVersion "24.0.2"
...
}
Maybe you can update the ndk version.
I update the ndk version from r10 to r13,and finally it worked.
You might want to check if the location of your NDK folder has any white space in it...if it has you can move your ndk folder to the c:\ drive and rebuild
Also, check the gradle versiom of your app and either upgrade or download later version, because some ndk versions do not support later gradle version
Before last month, I have been using Eclipse for android development. But now I am trying to use android studio because of the google's policy.
I am so tired.
I ran across this error
I don't understand this message. Because I don't use "Build Tools revision 23.0.0 rc" I am using 22.0.0.
compileSdkVersion 22
buildToolsVersion "22.0.0"
But I met that's error continue. So I downloaded and Installed Build Tools 23.0.0 rc2. But I met network error.
Solutions please. I am tired.
it happens because of build tools inconsistency. Firstly make sure 22 is installed then 23rc is not installed.
After that in your Android Studio Open Gradle Scripts >> build.gradle (Module:app). Make sure the installed build tool which is 22.0.1 in me is declared here. After changing the numbers make sure you rebuild/sync/refresh the project. And you are done.
Note: Make sure this is done to all of your projects
I am new to the Android programming. But I now get this error.
On 8/28/2015, I have with the SDK Manager on the Android Studio (1.3.2 Build 141.2178183), while my current project was opened, installed new, previously not installed packages and also I have done other recommended update. Subsequently, I received the error message "Install Build Tool revision 23.0.0. rc2" and "Gradle project sync failed. Basic functionality (e.g... Try Again Open 'Messages' View Show Log in Explorer".
I have tried it without success.
Uninstall/new install Build-Tools in the SDK manager brought no change. There was a "Build Tools revsion 232.0 rc2" also not to be found.
Therefore, I have looked at the Grandle files accurately. The file build.gradle (Module: app) in
C: \ Users \ \ AndroidStudioProjects \ \ app \ build.gradle contained the following entry:
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
I have changed this with an editor:
android {
compileSdkVersion 22
buildToolsVersion "23.0.0"
Then I could call up the project again without errors and also perform a synchronization.
I tried above solution it seemed not to work at first but try looking into all build files. For example if your project has got multiple modules say wearable module or like update its gradle build file too.
It seems to be answered perfectly here:
https://stackoverflow.com/a/28159380/3436166
Just install the required version of Build Tools and the dependency issue will be solved.
I have a Gradle build file that contains the following section:
android {
compileSdkVersion 18
buildToolsVersion "18.0.0"
This defines the exact version of build tools to use. Is it possible to specify this as a min requirement as it is for dependencies?
I tried:
android {
compileSdkVersion 18
buildToolsVersion "18.0.+"
to automatically use minor updates of the build tools if available but that isn't working.
It produces the following error:
A problem occurred evaluating root project '####'.
Invalid full revision: 18.0.+
This is an intentional choice. The idea is that your build should be perfectly repeatable, and if you build on a different machine that may have a later version of the build tools, it won't suddenly start having errors. I could see an argument for wildcarding to the latest bugfix release ala 18.0.+ the way it does for other version strings in Gradle, but even then that breaks repeatability if there's a regression in the newer version of the build tools.
The relevant feature request for this is at https://code.google.com/p/android/issues/detail?id=59550