无法安装 APK [INSTALL_FAILED_DEXOPT] Android Studio [英] Failure to install APK [INSTALL_FAILED_DEXOPT] Android Studio

查看:30
本文介绍了无法安装 APK [INSTALL_FAILED_DEXOPT] Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试将应用程序部署到实际的 android 设备进行调试时,我已经尝试了几乎所有方法来尝试纠正此错误,但一直无法解决问题.每次我尝试启动时,我都会收到失败的 [INSTALL_FAILED_DEXOPT] 错误,并且在检查 logcat 时总是因为我的调试 apk 中没有 classes.dex.

I have tried literally everything to try and rectify this error when trying to deploy an app to an actual android device for debugging but have been unable to solve the matter. Everytime I try to launch I get a failed [INSTALL_FAILED_DEXOPT] error and when checking the logcat it is always because there is no classes.dex in my debug apk.

如果我运行 gradlew.bat clean assembleDebug,apk 大小没有区别,所以我假设 android studio 中存在构建错误.我正在使用 android studio beta 0.86 并在 0.89 上尝试过,结果相同.我尝试了 19.1 到 21 的构建工具,但没有结果.我还尝试了不同的设备并创建了一个新项目(从未在我的设备上安装过)并且 android studio 似乎认为在尝试部署时需要先卸载它.

If I run gradlew.bat clean assembleDebug, there is no difference in the apk size so I'm assuming there is a build error in android studio. I am using android studio beta 0.86 and have tried it on 0.89 with the same result. I have tried build tools for 19.1 to 21 with no result. I have also tried different devices and created a new project (that has never been installed on my devices) and android studio seems to think it needs to be uninstalled first when attempting to deploy.

我尝试将我的设备切换到 ART,卸载并重新安装 android studio,重新下载 sdk 并重新启动我的计算机.没有,我的意思是没有任何效果.我认为问题是在我下载棒棒糖 apis 后开始的,但我不确定.我已经尝试在我的设备上卸载带有我的包签名的所有应用程序,但没有任何效果!甚至没有 Project -> Clean Project -> Rebuild

I have tried switching my device to ART, uninstalling and reinstalling android studio, redownloading the sdk and restarting my computer. NOTHING and I mean NOTHING has worked. I think the problem started after I downloaded the lollipop apis but am not sure. I have tried uninstalling all apps with my package signature on my device but NOTHING works! Not even Project -> Clean Project -> Rebuild

这非常令人沮丧,因为我无法再调试我的应用程序:/有没有人有过这个错误的经验或纠正它的方法?

This is extremely frustrating as I cannot debug my apps anymore :/ has anyone had any experience with this error or ways to rectify it?

推荐答案

原来问题是 Android Studio 和项目之间的 sdk 不匹配.该项目使用的是旧的 sdk,一旦我使它们相同,我就清理并重建了该项目,一切都很好.

So turns out that the issue was mismatching sdks between Android Studio and the Project. The project was using an old sdk and once I made them the same, I cleaned and rebuilt the project and everything was good to go.

更新:

在我尝试更新我的 SDK 及其工具后,我再次遇到了这个问题.事实证明,当您尝试执行此操作时,SDK 会锁定工具文件夹,然后您会收到一条错误消息,指出无法覆盖某些文件.当我遇到这种情况时,所有构建工具都被删除了,因此在调试我的应用程序时创建的 .dex 文件中存在错误.

I ran into the problem again after I tried to update my SDK and its tools. Turns out that when you try to do this, the SDK locks the tools folder and then you get an error saying some file couldn't be overridden. When this happened to me, all the build tools were deleted so there were errors in the .dex file created when debuggin my app.

这篇关于无法安装 APK [INSTALL_FAILED_DEXOPT] Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆