我正在使用Android 2.2开发一个Android应用程序,我的应用程序APK大小是22.5 MB,我想为三星平板电脑创建一个新的构建。我得到了以下错误:

INSTALL_FAILED_DEXOPT

如何解决这种错误?


当前回答

我正在使用Android Studio,也出现了同样的错误。

删除主模块的构建文件夹有帮助。删除后一切恢复正常。

其他回答

通过纠正电话上的日期时间(它是一些默认日期01.01.1980),并清理项目来解决。

您正在安装的应用程序的旧版本有已更改的依赖库/ jar。我在更新我的应用程序引用的其他jar文件时遇到了这个问题。

你将需要卸载旧版本,然后你应该没有更多的问题…

设置—>应用程序—>管理应用程序—>[找到并卸载您的应用程序]

INSTALL_FAILED_DEXOPT错误不应该爆发。就像

[2011-06-14 01:23:40 - ProtectYourself] Installing ProtectYourself.apk...
[2011-06-14 01:24:26 - ProtectYourself] Installation error: INSTALL_FAILED_DEXOPT
[2011-06-14 01:24:26 - ProtectYourself] Please check logcat output for more details.
[2011-06-14 01:24:26 - ProtectYourself] Launch canceled!

呜。

因为这似乎是我自己遇到过多次的问题,这次没有一个分享的解决方案对我有帮助,我仍然会发布一些对我个人有帮助的东西,以及我认为将来可能会帮助其他人的东西:

进入项目目录,找到build/intermediates/dex-cache/cache文件。删除它——顾名思义,这是一个缓存的dex文件,如果你改变了项目的依赖关系,构建工具版本等,它可能已经过时了。

targetSdkVersion 22//17==========================>设置这个数字小于或等于设备上的Android操作系统版本可能会有帮助

 defaultConfig {
        applicationId "software.nhut.personalutilitiesforlife"
        minSdkVersion 16
        targetSdkVersion 22//17==========================> set this number less then or equal to the version of Android OS on devices might help
        versionCode 5
        versionName "1.26"
        // Enabling multidex support.
        multiDexEnabled true
    }

给任何搜索关键词“房间”的人。我在实现Room来管理数据库时遇到了这个问题。原因是我从Android文档中复制了所有依赖项。只复制你需要的文件。如果您没有使用Kotlin或番石榴,只需添加:

implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
testImplementation "androidx.room:room-testing:$room_version"