[英]Android: ERROR: Cause: compileSdkVersion is not specified
I have seen many similar questions, but none of the solutions fixed my problem.我见过很多类似的问题,但没有一个解决方案能解决我的问题。 I get the following error on Android Studio ERROR:我在 Android Studio ERROR 上收到以下错误:
Cause: compileSdkVersion is not specified.原因:未指定 compileSdkVersion。
My code on build.gradle
file inside the app folder is the following:我在 app 文件夹中的build.gradle
文件上的代码如下:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.adam.modernartuivangelis"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'androidx.appcompat:appcompat:1.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.41"
}
I also migrated to Android X, but still the same problem我也迁移到Android X,但还是同样的问题
Path: android/app/build.gradle
路径: android/app/build.gradle
defaultConfig {
applicationId "com.awesomeproject"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
compileSdkVersion rootProject.ext.compileSdkVersion
versionCode 1
versionName "1.0"
}
Add this line to defaultConfig: compileSdkVersion rootProject.ext.compileSdkVersion
将此行添加到 defaultConfig: compileSdkVersion rootProject.ext.compileSdkVersion
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.