首页 > 解决方案 > 我的应用在运行 Android 版本低于 9 的设备上崩溃

问题描述

我正在三星远程实验室测试我的应用程序,发现它在运行低于 9 的 Android 设备上不断崩溃。

在谷歌上搜索只会让我更加困惑,并意识到我的无知是多么巨大。

build.cradle:

    android {
    compileSdkVersion 28
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.photobangkok.moneytalk"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
        implementation 'com.google.android.gms:play-services-ads:20.1.0'
}

当我尝试将 minSDKversion 降低到 14 时,出现以下错误:

清单合并失败:uses-sdk:minSdkVersion 14...

我在这个应用程序中展示广告,所以我需要使用 adroidx。

标签: androidsdkcrash

解决方案


推荐阅读