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.
Related
I've installed Android studio 3.0.1 then tried to build very first app by choosing an empty activity, but I've got this message:
Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly
and the error message like this:
Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Could not resolve com.android.support:appcompat-v7:26.1.0.
Required by:
project :app
Could not resolve com.android.support:appcompat-v7:26.1.0.
> Could not parse POM https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom
> Already seen doctype.
The first part of log message is like this:
2018-01-03 11:11:12,671 [d thread 8] WARN - ect.sync.idea.ProjectSetUpTask - Already seen doctype.
Consult IDE log for more details (Help | Show Log)
2018-01-03 11:11:12,671 [d thread 8] INFO - e.project.sync.GradleSyncState - Gradle sync failed: Already seen doctype.
I've tried some suggested solutions like changing gradle version, update Kotlin plugin(!) and so, but they didn't work.
Any solution?
This problem occurs when the Build Tools Version is not set for the project.
You just set the build tools version by following this process...
By opening your project structure [File->Project Structure] and selecting the Build Tools Version from app's property tab in Modules section.
This will add build tools version to your gradle file (Module:app) and re-sync the project.
The problem caused by my connection. I needed to set proxy to download some components.
For me the issue was one of the external libraries required SDK 28 but android studio didnt have it so it did not work. I installed SDK 28 and the problem was fixed. I saw the problem in the log file it generated
The error happens under fluctuating network. So at first make sure your connection is stable. Plus, if you are using any VPN check your gradle.properties is configured correctly.
The correct form of VPN connection on gradle.properties is as follows,
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=8080
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=8080
My host connection is 127.0.0.1, and its port is 8080 for both http and https.
Just one more thing, make sure adding https (It is mandatory).
I had the same problem when i was upgrading to android studio 3.1.2 and the problem i was using the previous JDK which i installed before 5 years back.
The steps:-
Go to File -> Project Structures -> SDK Location -> JDK Location -> check the
Option Use embedded JDK (recommended).
I tried all suggestions, only one works for me:
open 'Gradle' tab on right vertical panel
right click on project name
'Refresh Gradle Dependencies' and wait background downloading
right click on project name again
'Reload Gradle Project' and wait refreshing
I was also stuck with the same issue for quite few minutes till I figured out the solution:
So you have to visit Gradle Releases and
there scroll down a little bit and you will find the plugin version and required gradle version. Make sure you use the latest version of both or the ones which are compatible with each other.
For today I am using :
Android Gradle Plugin Version - 7.0.2
Gradle Version - 7.2
You can update it by navigating to:
> File -> Project Structure -> Project
Suddenly My Project showing this Error(Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly). Then i Try to various solutions but not solved.
Then i close the android studio, and open the project location and delete the .idea and .iml file, After deleting this file open the project again on Android studio, after that the project working fine.
I had the same problem, I did download gradle version and used it as a local distribution.
Settings/Build,../Gradle/Use local distribution.
Else you will have to reinstall all the software.
The solution is kinda of very simple.
It's because the "compileSdkVersion" that you are using
in your build.gradle (Module:app) is higher than the SDK installed in your Android studio.
Now, what to do?
Just go on SDK Manager and download an Api Level higher or equal to your "compileSdkVersion" and you're done
Look at the manifest, something may have to go wrong there. In my case I had this label
<uses-sdk android: minSdkVersion = "7" android: targetSdkVersion = "15" />, which was from an example.
Then the error is displayed, and the correspondent is now updated <uses-sdk android: minSdkVersion = "15" android: targetSdkVersion = "27" />
As #oyeraghib said,
Visit this link to check the compatibility of your Android Gradle Plugin in comparison with Gradle itself. I was using an older version of both and updated to version 7 in both.
File -> Project Structure -> Project
It may take a while. Wait for it to load.
change the grade version to the latest one in gradle-wrapper
Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly
Go to gradle scripts -> build gradle(app) -> made following changes:
Finally it works.
I'm trying to get a ReactNative Android app up and running, but after going through the initial setup guide, I get the error:
Error:Failed to find target with hash string 'android-26' in:
/Users/nicholasstephan/Library/Android/sdk
Install missing platform(s) and sync project
I don't want to install and use SDK v26, React Native specifically uses v23.0.1. I'm not sure where that reference to v26 comes from.
Any ideas where that reference to android-26 could be coming from?
Either you are saying that it should compile with Android 26 (targeting and compiling could have two different target versions) or some of your dependencies are asking for that specific version.
Check all your node-modules for build.gradle and settings.gradle files.
This is due to maven repo URL, I faced same issue in android studio As it can't find android-26 but it can 26
I suggest to check
1 . youProject/android/app/build.gradle
2 . youProject/android/app/src/main/AndroidManifest.xml
and search for 'android-26' string and make it just 26
In my case it was compileSdkVersion 'android-26'
so I change it to compileSdkVersion '26'
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.
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 am using Android Studio version 1.2.1.1,and every time when create a new app ,error log shows "Error:Execution failed for task ':app:compileDebugAidl'.
aidl is missing" ,I know the solution for this problem is ,to write click on the app directory and select open module settings ,and compiled sdk version and build tool version must set accordingly.I need a proper solution for this problem and i don't want to repeat all these steps on every app creation.Can anybody help me out plz???
You have an invalid combination of project settings in your Gradle build files, probably caused by your installing the M Developer Preview bits from the SDK Manager.
Unless you are specifically trying to test the M Developer Preview, change your buildToolsVersion to be 22.0.1 in your app module's build.gradle file. Right now, it is probably something like 23.0.0_rc1.
May be you are using the Build Tools 23.0.0_rc1. In this case you have to use the gradle plugin 1.3.0-beta1.
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0-beta1'
...
}
}
If you are using the build tools 22.0.1, you can use the gradle plugin 1.1.x or 1.2.x
I was also facing the same problem.
Select the app folder and press F4. It'll open the Modular Settings.
(Right-clicking and selecting 'Open Modular Settings' will also do.)
Change 'Build tool version to "22.0.1" from "23.0.0 rc1".
Now this should work.
Downgrading "Build tool version" is a workaround, not a solution.
Please check this answer: https://stackoverflow.com/a/32495797/4160928