Android应用安装失败,错误:[INSTALL_FAILED_DEXOPT]

时间:2014-04-06 20:48:39

标签: android gradle android-studio dalvik

为了解释我的问题,我已经查看了我在StackOverflow和网络上找到的所有类似问题但没有成功。我使用真实设备开发了几个月没有任何问题。昨天我将之前使用过的Android Studio更新为0.5.4版本。此更新要求我升级到Gradle 0.9版,因为构建系统显然有一些重大更改。自从升级IDE以来,当我尝试在设备上运行项目时,我在运行控制台中获得以下输出:

运行控制台输出

Waiting for device.
Target device: samsung-sch_i605-42f7bff119a3bf69
Uploading file
    local path: C:\Users\student\Android studioProjects\DrunkModeAndroid\DrunkMode\build\apk\DrunkMode-debug-unaligned.apk
    remote path: /data/local/tmp/com.launchfuture.drunk_mode
Installing com.launchfuture.drunk_mode
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.launchfuture.drunk_mode"
pkg: /data/local/tmp/com.launchfuture.drunk_mode    // this line is red
Failure [INSTALL_FAILED_DEXOPT]                     // this line is also red

Logcat输出

04-06 14:44:00.066    8040-8040/? D/Finsky﹕ [1] WorkerTask.onPreExecute: Verification Requested for id = 21, data=file:///data/local/tmp/com.launchfuture.drunk_mode flags=114 fromVerificationActivity=false 
04-06 14:44:01.586  12740-12740/? W/dalvikvm﹕ DexOptZ: zip archive '/data/app/com.launchfuture.drunk_mode-1.apk' does not include classes.dex 
04-06 14:44:01.591    2001-2001/? W/installd﹕ DexInv: --- END '/data/app/com.launchfuture.drunk_mode-1.apk' --- status=0xff00, process failed 
04-06 14:44:01.591    2001-2001/? E/installd﹕ dexopt failed on '/data/dalvik-cache/data@app@com.launchfuture.drunk_mode-1.apk@classes.dex' res = 65280 
04-06 14:44:01.591    2410-2621/? W/PackageManager﹕ Package couldn't be installed in /data/app/com.launchfuture.drunk_mode-1.apk

的build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.9.+'
    }
}
apply plugin: 'android'

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.google.code.gson:gson:2.2.+'
    compile files('libs/Parse-1.4.0.jar')
    compile files('libs/GoogleAnalyticsServicesAndroid_3.01/libGoogleAnalyticsServices.jar')
    compile 'com.google.android.gms:play-services:4.1.32'
}

android {
    compileSdkVersion 19
    buildToolsVersion '19.0.0'

    defaultConfig {
        minSdkVersion 13
        targetSdkVersion 19
    }
}

我的Android设备已植根,因此我可以查看指定位置的文件系统。值得注意的是,data@app@com.launchfuture.drunk_mode-1.apk@classes.dex目录中不存在对/data/dalvik-cache/的引用。你们有没有处理这个问题的经验?

2 个答案:

答案 0 :(得分:1)

请您清空/ data / dalvik-cache的内容并重新启动(或从恢复中删除dalvik缓存)以便重建它?

答案 1 :(得分:0)

在root用户手机上,安装幸运的修补程序,然后转到选项构建并通过幸运的修补程序安装,转到你要安装的SD卡中的所需apk,点击它并选择安装为系统应用程序...在进程重启后。 ..它可以以移动系统应用空间为代价。