可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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 synch 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?
回答1:
you don't need to update anything. Just download 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.
回答2:
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).
回答3:
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.
回答4:
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.
回答5:
the default gradle version 3.3 may have some bugs, I switched to gradle 3.5 and everything got ok
回答6:
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, everything is straightforward from there.