【发布时间】:2015-09-30 06:36:49
【问题描述】:
我正在尝试开发一个适用于所有 android 版本(如 API 级别 23 和 API 级别 8)的应用程序。在调试应用程序时,它在最新版本的 api 上运行良好,但不适用于 Gingerbread 等较低版本。
我尝试更改minSdkVersion,但这并没有解决问题。
在低版本调试时显示错误
“安装失败,因为设备可能有陈旧的 dexed jars 与当前版本不匹配(dexopt 错误)。为了 继续,您必须卸载现有的应用程序。”
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"
/>
【问题讨论】:
-
显示堆栈跟踪!
-
安装 org.linphone DEVICE SHELL 命令:pm install -r "/data/local/tmp/org.linphone" pkg: /data/local/tmp/org.linphone 失败 [INSTALL_FAILED_DEXOPT] DEVICE SHELL命令:pm uninstall org.linphone 未知故障@Anggrayudi H
-
您是否尝试过清除应用数据并手动卸载?
-
该应用程序尚未安装在“Gingerbread”中,正在尝试安装在“Gingerbread”中。所以...
标签: android android-studio gradle android-gradle-plugin build.gradle