Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to find Platform SDK with path: platforms;android-P

Error:FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring project ':app'.

Failed to find Platform SDK with path: platforms;android-P

apply plugin: 'com.android.application'

    android {
        compileSdkVersion 'android-P'
        defaultConfig {
            applicationId "com.google.codelabs.mdc.java.shrine"
            minSdkVersion 15
            targetSdkVersion 28
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            vectorDrawables.useSupportLibrary = true
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
     }

    dependencies {
        api 'com.android.support:design:28.0.0-alpha1'
        implementation 'com.android.support:support-v4:28.0.0-alpha1'
        implementation 'com.android.volley:volley:1.1.0'
        implementation 'com.google.code.gson:gson:2.8.2'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.1'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    }
like image 286
Jay Halani Avatar asked Jul 05 '18 04:07

Jay Halani


People also ask

How do I fix Android SDK is missing or corrupted?

Quick fix: Go to the Tools –> SDK manager –> SDK tools. Deselect Hide obsolete packages option on the right bottom and further install Android SDK Tools(obsolete).

What is compile SDK version?

compileSdkVersion is your way to tell Gradle what version of the Android SDK to compile your app with. Using the new Android SDK is a requirement to use any of the new APIs added in that level. It should be emphasized that changing your compileSdkVersion does not change runtime behavior.


2 Answers

Step 1: Open Preferences or Settings in Android studio. Select Android SDK options and Install Android API 28 as selected below.

install

Step 2: There's a problem with compileSdkVersion as you have to change it from 'android-P' to 28.

compileSdkVersion 28

And Build project. That's it.

like image 112
Jay Halani Avatar answered Sep 16 '22 11:09

Jay Halani


To fully test your app's compatibility with Android P and begin using new APIs, open your module-level build.gradle file and update the compileSdkVersion and targetSdkVersion as shown here:

android {
    compileSdkVersion 28

    defaultConfig {
        targetSdkVersion 28
    }
    ...
}

Set Up the Android P SDK

like image 43
Brijesh Joshi Avatar answered Sep 18 '22 11:09

Brijesh Joshi