minSdkVersion 21但仍在崩溃6.0

时间:2017-06-21 18:23:01

标签: android android-studio sdk

我的minSdkVersion设置为21,但我的应用无法在其他版本上运行,除了7. * 为了详细说明,该应用程序成功安装并在基于Nougat的ROM(API级别24和25)上完美运行,但在基于API 23或更低版本的ROM上,简单的不安装。它只是说app没有安装。 :(

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "com.rishav.t2"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "0.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.jakewharton:butterknife:8.6.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
    compile 'com.android.support:design:25.4.0'
    compile 'com.android.support:appcompat-v7:25.3.1'
    implementation 'com.android.support:support-v4:25.4.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    compile 'com.google.firebase:firebase-auth:11.0.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-database:11.0.1'
}




apply plugin: 'com.google.gms.google-services'

是因为我的compileSdkVersion设置为Nougat吗?

1 个答案:

答案 0 :(得分:0)

您的targetSDKVersioncompileSDKVersion必须匹配。确保已下载Android SDK Platform 26