简体   繁体   English

Android:错误:原因:未指定compileSdkVersion

[英]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.

相关问题 错误:原因:未指定compileSdkVersion - Error: Cause: compileSdkVersion is not specified 错误:原因:安装插件后未指定compileSdkVersion - Error: Cause: compileSdkVersion is not specified after install plugin 原因:没有指定compileSdkVersion - Cause: compileSdkVersion is not specified 错误:导致android.compileSdkVersion丢失 - Error : cause android.compileSdkVersion is missing React Native 中未指定 compileSdkVersion 错误 Android - compileSdkVersion is not specified error in React Native Android Gradle android更新后同步错误(未指定compileSdkVersion) - Gradle sync error after android update (compileSdkVersion is not specified) Gradle 同步失败: Cause: compileSdkVersion is not specified - Gradle sync failed: Cause: compileSdkVersion is not specified expo上未指定compileSdkVersion run android - compileSdkVersion is not specified on expo run android gradlew assembleRelease 抛出 compileSdkVersion is not specified 错误 - gradlew assembleRelease throwing compileSdkVersion is not specified error react-native-audio-recorder-player 错误 未找到 ID 为“kotlin-android”的插件。 compileSdkVersion 未指定 - react-native-audio-recorder-player error Plugin with id "kotlin-android" not found. compileSdkVersion is not specified
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM