Failed to install APK [INSTALL_FAILED_DEXOPT] Android Studio

I tried to literally try everything and fix this error when I tried to deploy the application on a real Android device for debugging, but could not solve the problem. Every time I try to start, I get an unsuccessful error [INSTALL_FAILED_DEXOPT], and when checking logcat this is always because there is no class.dex in my debug apk.

If I run gradlew.bat clean assembleDebug there is no difference in apk size, so I assume there is a build error in android studio. I am using the android studio beta version 0.86 and tried it at 0.89 with the same result. I tried to build tools for 19.1 to 21 with no results. I also tried different devices and created a new project (which was never installed on my devices), and it seems like android studio thinks that it needs to be removed when trying to deploy.

I tried switching my device to ART, uninstalling and reinstalling Android studio, rebooting sdk and rebooting the computer. NOTHING, and I mean, NOTHING worked. I think the problem started after I downloaded lollipop apis, but not sure. I tried to remove all applications with my package signature on my device, but NOTHING works! Even Project β†’ Clean Project β†’ Reconstruction

This is very unpleasant, because I can no longer debug my applications: / does anyone have any problems with this error or ways to fix it?

+7
android debugging android-studio apk dex
source share
5 answers

Thus, it turns out that the problem is not compatible with sdks between Android Studio and Project. The project used the old sdk, and as soon as I made them the same, I cleaned and rebuilt the project, and everything was fine.

UPDATE:

I ran into a problem again after trying to update the SDK and its tools. It turns out that when you try to do this, the SDK blocks the tool folder, and then you get a message that some file cannot be overridden. When this happened to me, all the build tools were deleted, so there were errors in the .dex file created when debugging my application.

+7
source share

We are using android 2.2 (really old, I know) and could not find a fix for this error. In the end, we found this error https://android-review.googlesource.com/#/c/30900/ . The only solution for us was to remove some libraries ...

+1
source share

I had the same problem - manual build worked fine, but Android Studio did not create a suitable APK.

The problem was that I started a project on Android Studio and the Android Gradle plugin version 2.0-beta2. After upgrading the Gradle plugin to version 2.0-beta6 with a simple change to build.gradle, the builds stopped working.

It turns out that although I installed the beta version of Android Studio, the update check only checked the stable channel. After installing the update to check the channel channel, I was able to update Android Studio to version 2.0-beta6, and the assembly continued to work normally.

You can change the update settings in the settings of Android Studio in the section Appearance and behavior β†’ System settings β†’ Updates.

+1
source share

I encountered this error when the device memory is full. Try to open some space.

0
source share

Try these commands adb reconnect adb reconnect device

0
source share

All Articles