[英]Can't build apk on Android Studio without minSdkVersion 28
由於以下錯誤,我無法在 Android Studio(3.5.3) 上構建我的應用程序的 apk:
Dex file with version '39' cannot be used with min sdk level '23'.
但是我可以通過 adb 在模擬器或我的 android 設備上完美地運行它。 將 minSdkVersion 更改為 28 解決了問題,但我想針對舊版本(我使用 minSdkVersion 23 成功構建了舊版 apk)。
這是我的 build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.axiel7.weeb"
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "0.2.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.preference:preference:1.1.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
implementation 'com.google.android.material:material:1.1.0'
}
通過將android studio更新到新的3.6版本解決
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.