作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试开发一个可以在所有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."
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'
}
}
<uses-sdk
android:minSdkVersion="9"
/>
最佳答案
您正在使用gradle,因此应从manifest.xml中删除uses-sdk声明-gradle会自行添加它。然后将build.gradle中的minSdkVersion更改为等于或低于所需值。
关于android - Android应用程式无法在较低版本(例如Gingerbread)中运作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32859375/
我是一名优秀的程序员,十分优秀!