错误:失败:构建失败并出现异常。
- 出了什么问题:配置项目“:app”时出现问题。
找不到路径为 Platform SDK 的平台: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'
}
原文由 Jay Halani 发布,翻译遵循 CC BY-SA 4.0 许可协议
第 1 步:在 Android studio 中打开首选项或设置。选择 Android SDK 选项并安装 Android API 28,如下所示。
第 2 步:compileSdkVersion 有问题,您必须将其从“android-P”更改为 28。
并构建项目。而已。