找不到路径为:platform; android-P的Platform SDK [英] Failed to find Platform SDK with path: platforms;android-P

查看:386
本文介绍了找不到路径为:platform; android-P的Platform SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误:失败:构建失败并出现异常.

Error:FAILURE: Build failed with an exception.

  • 出了什么问题: 配置项目':app'时发生问题.
  • What went wrong: A problem occurred configuring project ':app'.

无法找到路径为:platforms; android-P

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'
    }

推荐答案

步骤1:在Android Studio中打开偏好设置"或设置".选择"Android SDK选项",然后如下所示安装"Android API 28".

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

第2步:compileSdkVersion存在问题,因为您必须将其从"android-P"更改为28.

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.

这篇关于找不到路径为:platform; android-P的Platform SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆