我有一个已升级的旧 Android 应用程序。我已经更新了所有 Gradle 依赖项,将 targetSdkVersion 设置为 34,并进行了必要的更改以确保兼容性。但是,当我在运行 Android 14 的设备(特别是 Galaxy S24 Ultra)上安装该应用程序时,它无法安装。在运行 Android 14 的其他设备上,我收到一条警告:
“此应用与最新版本的 Android 不兼容。请联系开发者获取支持。”
尽管更新了所有依赖项、Gradle 版本和其他配置,但在安装过程中我仍然看到此警告。我已经彻底检查了项目设置,包括:
将 targetSdkVersion 更新为 34 更新了所有 Gradle 依赖项和插件 迁移了必要的代码以处理任何已弃用的 API Android 14 上出现此警告的原因是什么?如何解决? 这是我的成绩:
apply plugin: "com.android.application"
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics' // This applies the Crashlytics plugin
apply plugin: 'io.objectbox'
android {
namespace 'arpamanagement.com.app.managementreports'
compileSdk 34
defaultConfig {
applicationId "arpamanagement.com.app.managementreports"
minSdk 23
targetSdk 34
versionCode 1040
versionName 'arpa-7.2.54(alpha-5)'
multiDexEnabled true
renderscriptTargetApi 21
renderscriptSupportModeEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
// lintOptions {
// checkReleaseBuilds false
// }
lintOptions {
// تبدیل همه خطاها به هشدار
abortOnError false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.debug
debuggable true
}
// debug {
// firebaseCrashlytics {
// mappingFileUploadEnabled false
// }
// }
}
dataBinding {
enabled = true
}
viewBinding {
enabled = true
}
sourceSets {
main {
java.srcDirs = ["src/main/java", "src-gem"]
}
}
splits {
abi {
enable true
reset()
include 'armeabi-v7a'
universalApk false
}
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// Firebase & Google Play Services
implementation platform('com.google.firebase:firebase-bom:33.3.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-messaging:24.0.1' // یا آخرین نسخه
implementation "com.google.android.gms:play-services-location:21.3.0"
implementation "com.google.android.gms:play-services-gcm:17.0.0"
implementation "com.google.android.gms:play-services-maps:19.0.0"
implementation 'com.github.GrenderG:Toasty:1.5.2'
implementation 'com.jakewharton.rxbinding4:rxbinding:4.0.0'
// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// UI Libraries
implementation "com.google.android.material:material:1.12.0"
implementation "androidx.appcompat:appcompat:1.7.0"
implementation "androidx.recyclerview:recyclerview:1.3.2"
implementation 'com.etsy.android.grid:library:1.0.5'
// Retrofit & OkHttp
implementation 'com.google.code.gson:gson:2.11.0'
implementation 'com.squareup.retrofit2:retrofit:2.11.0'
implementation 'com.squareup.retrofit2:converter-gson:2.11.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
// RxJava & RxAndroid
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.11.0'
// Image & File Libraries
implementation 'com.github.bumptech.glide:glide:4.16.0'
kapt 'com.github.bumptech.glide:compiler:4.16.0'
implementation 'com.google.android.gms:play-services-vision-common:19.1.3'
implementation 'com.google.android.gms:play-services-base:18.5.0'
implementation 'com.itextpdf:itextg:5.5.10'
// Additional libraries
implementation 'com.orhanobut:hawk:2.0.1'
implementation 'com.orhanobut:logger:2.2.0'
// implementation 'com.github.rubensousa:gravitysnaphelper-compat:2.1.0'
implementation 'com.github.rubensousa:gravitysnaphelper:2.2.2'
implementation 'com.google.guava:guava:27.0.1-jre'
// implementation 'me.dm7.barcodescanner:zxing:1.9.8'
implementation 'ir.huri:JalaliCalendar:1.3.3'
// ObjectBox
implementation "io.objectbox:objectbox-android:$objectboxVersion"
kapt "io.objectbox:objectbox-processor:$objectboxVersion"
implementation "io.objectbox:objectbox-kotlin:$objectboxVersion"
// Custom Projects
implementation project(path: ':lockscreen')
implementation project(path: ':horizonalnumberpicker')
implementation project(path: ':rahyab-hybrid-cpsdk-1.0.5')
implementation project(path: ":searchablespinnerlibrary")
implementation project(path: ":numberpicker")
implementation project(path: ":longpresspopup")
// New dependencies from the updated file
implementation 'com.intuit.sdp:sdp-android:1.1.1'
implementation 'com.intuit.ssp:ssp-android:1.1.1'
implementation 'com.github.florent37:expansionpanel:1.2.4'
implementation 'com.google.android.libraries.places:places:4.0.0'
// CameraX
implementation "androidx.camera:camera-core:1.3.4"
implementation "androidx.camera:camera-camera2:1.3.4"
implementation "androidx.camera:camera-lifecycle:1.3.4"
implementation "androidx.camera:camera-view:1.3.4"
implementation 'com.google.mlkit:barcode-scanning:17.3.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation "androidx.work:work-runtime-ktx:2.9.1"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.8.6" // or the latest version
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
// This is optional and deprecated but might help
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.6" // for ViewModel usage
implementation 'com.github.AnwarSamir:FontAwesome:1.0.1'
implementation 'com.github.samanzamani:PersianDate:1.7.1'
implementation 'com.github.gcacace:signature-pad:1.3.1'
implementation 'neshan-android-sdk:mobile-sdk:1.0.1'
implementation 'neshan-android-sdk:services-sdk:1.0.0'
implementation 'neshan-android-sdk:common-sdk:0.0.2'
implementation 'com.google.firebase:firebase-crashlytics-ktx:19.2.0' // or latest version
// Testing
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '2.0.20'
ext.objectboxVersion = '4.0.2'
repositories {
google()
mavenCentral()
maven { url 'https://maven.google.com/' }
maven { url 'https://jitpack.io' } // Ensure this is uncommented if you're using JitPack
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"
classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.2'
classpath 'com.google.gms:google-services:4.4.2'
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" } // Ensure JitPack is included
maven { url "https://maven.neshan.org/artifactory/public-maven" }
}
ext {
myMinSdk = 23
myTargetSdk = 34
myCompileSdk = 34
myBuildTools = '34.0.0'
mySourceCompatibilityVersion = JavaVersion.VERSION_17
myTargetCompatibilityVersion = JavaVersion.VERSION_17
// mySupportLibraryVersion = '28.0.0'
}
}
apply from: "./dependencies.gradle"
ext {
versionName = "1402.03.18"
var = 'key0'
var1 = '123456'
var2 = '123456'
var3 = var
var4 = 'F:\\Project\\Android\\arpaKey\\arpaKey.jks'
var5 = var
var6 = var1
var7 = var
var8 = 'F:\\Project\\Android\\arpaKey\\arpaKey.jks'
}
task clean(type: Delete) {
delete rootProject.buildDir
}
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
问题与这部分有关 分裂{ 阿比{ 启用真 重置() 包括“armeabi-v7a” 通用Apk错误 } } 我在这部分添加了arm64-v8a,问题解决了。