gpt4 book ai didi

android - Android应用程式无法在较低版本(例如Gingerbread)中运作

转载 作者:行者123 更新时间:2023-12-03 18:14:00 25 4
gpt4 key购买 nike

我正在尝试开发一个可以在所有Android版本(如API级别23和API级别8)上运行的应用程序,在调试该应用程序时,它可以在最新版本的api上完美运行,但不能在像Gingerbread这样的较低版本上运行。

我尝试更改minSdkVersion,但这没有解决问题。

在较低版本中进行调试时,它显示错误

"Installation failed since the device possibly has stale dexed jars that don't match the current version (dexopt error). In order to proceed, you have to uninstall the existing application."



Build.gradle
apply plugin: 'android'

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.google.android.gms:play-services:7.8.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:support-v4:21.0.3'
}
android {
compileSdkVersion 22
buildToolsVersion "21.0.0"

defaultConfig {
applicationId "org.linphone"
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName "1.0"
}

sourceSets {

debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
android {
defaultConfig {
multiDexEnabled = true
minSdkVersion
targetSdkVersion
}
}

configurations.all {
exclude group: 'com.android.support', module: 'support-annotations'
}
}

Manifest.xml
    <uses-sdk
android:minSdkVersion="9"
/>

最佳答案

您正在使用gradle,因此应从manifest.xml中删除uses-sdk声明-gradle会自行添加它。然后将build.gradle中的minSdkVersion更改为等于或低于所需值。

关于android - Android应用程式无法在较低版本(例如Gingerbread)中运作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32859375/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com