0

我正在更改minSdk版本,但是当我构建/生成 apk 时,出现此错误:

链接参考失败。

我尝试过使缓存无效并重新启动

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.clubs"
        minSdkVersion 21
        targetSdkVersion 27
        vectorDrawables.useSupportLibrary = true
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    productFlavors {
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
    implementation 'com.google.android.material:material:1.1.0-alpha04'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    implementation 'com.jakewharton:butterknife:8.8.1'
    implementation 'nl.psdcompany:duo-navigation-drawer:3.0.0'
    implementation 'com.github.ApendIr:slider:1.0'
    implementation 'com.azoft.carousellayoutmanager:carousel:1.2.4'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.2-alpha01'
    implementation 'com.jakewharton:butterknife:10.1.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.2-alpha01'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}

我不知道这是否是导致某些手机中的应用程序崩溃的原因

4

1 回答 1

0

在项目的 AndroidManifest.xml 文件中设置最低 SDK 版本:

<uses-sdk android:minSdkVersion="21"/>
于 2019-04-17T13:46:17.490 回答