安装失败,因为设备可能有与当前版本不匹配的陈旧dexed jar(dexopt错误)

Pro*_*mer 20 failed-installation android-2.3-gingerbread dexopt android-studio

我无法从Android工作室运行应用程序到运行android 2.3.6的samsumg手机.我正在获取应用程序安装失败的弹出窗口参见下面的截图.

在此输入图像描述

当我点击OK我在日志中得到以下错误

Failure [INSTALL_FAILED_DEXOPT]
DEVICE SHELL COMMAND: pm uninstall my.package.name
Unknown failure
Run Code Online (Sandbox Code Playgroud)

在添加名为"带有Google Cloud Messaging的App Engine后端"的Google云端模块后,我遇到了麻烦.

这与此处的堆栈溢出问题中描述的问题完全相同

我尝试了接受的答案.

Ran dex-method-counts应用程序我在终端获得了"总方法计数:24474".我不明白接下来该做什么?

(注意:在kitkat上运行的其他设备上运行相同的应用程序.)

请帮助解决此问题.我过去两天都在苦苦挣扎.我知道有很多类似的问题,但没有任何帮助我.

内置 - >清洁不起作用.

这是我的build.gradle文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "my.package.name"
        minSdkVersion 9
        targetSdkVersion 19
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}


dependencies {
    compile files('libs/libGoogleAnalyticsServices.jar')
    compile project(path: ':gcmAppEngineBackend', configuration: 'android-endpoints')
    compile 'com.android.support:support-v4:22.0.0'
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.google.android.gms:play-services:7.0.0'

}
Run Code Online (Sandbox Code Playgroud)

提前致谢!

DrG*_*use 17

当我收到此错误时,我在 AVD-Manager 中使用了 Nexus 4。默认情况下,此设备创建时具有 500MB 的内部存储空间。我将存储增加到 2048MB,“过时的 dexed”错误消失了。

增加内部存储:

  1. 转到 ADV 管理器
  2. 在“操作”下选择对应设备的编辑按钮
  3. 点击“显示高级设置”
  4. 增加您的内部存储


Jor*_*ego 12

这通常是因为您的设备内存空间不足.

删除一些应用,然后重试


Ken*_*Ken 8

如果它是一个 Android 模拟器给你一个“陈旧的 dexed”消息,对我在 Mac 上有帮助:

  1. 停止模拟器
  2. cd ~/.android/avd/[模拟器名称].avd
  3. rm *.lock
  4. 擦除模拟器
  5. 启动模拟器


小智 7

我通过 Wiping data 解决了这个问题。

Android Studio -> AVD Manager -> 操作 -> 擦除数据


小智 0

我也有同样的问题。为了使其工作,我必须从依赖项中删除“第三方库”。或者试试这个: https: //developer.android.com/tools/building/multidex.html

  • 虽然此链接可以回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接的答案可能会变得无效。 (2认同)