Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to find target with hash string 'android-25'

Tags:

android

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?

like image 378
KurioZ7 Avatar asked Nov 07 '16 03:11

KurioZ7


2 Answers

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.Android SDK Manager Android Studio 2.2.2

like image 180
Anuja Kothekar Avatar answered Nov 07 '22 10:11

Anuja Kothekar


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

  1. compileSdkVersion 25

  2. buildToolsVersion "25.0.1"

  3. 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:

enter image description here

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).

like image 27
Hasnat Shah Avatar answered Nov 07 '22 10:11

Hasnat Shah