Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't upload Android app to device (stale dexed jars)

I am using Android Studio to develop this app, and today when I tried to upload it to my device to test I got a popup window saying:

Installation failed since the device possibly has stale dexed jars that don't match the current version (dexopt error). In order to proceed, you have to uninstall the existing application.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

It gave two options, OK or Cancel. Upon hitting OK, the following message showed up in the Run tab:

DEVICE SHELL COMMAND: pm uninstall my.bundle.id
Unknown failure

The app seems to be uninstalled, the is no trace of it under Manage Applications.
I am unable to upload the app. I tried cleaning the project and rebuilding, but it didn't work.

What can I do?

like image 821
Guilherme Avatar asked Aug 25 '14 19:08

Guilherme


4 Answers

I have also encountered this problem in Android Studio, from version 2.0 Preview 6 all the way up to 2.0 Beta 3 and none of the solutions mentioned here worked for me.

Turned up it had nothing to do with Instant Run. All I had to do was to increase the AVD's Internal Storage until the following notification disappeared. I also had to perform a data wipe after changing the values.

enter image description here

like image 135
Alexandru Pele Avatar answered Nov 03 '22 17:11

Alexandru Pele


I disabled Instant run for this project, and problem solved.

Maybe it's a bug in the instant run feature of Android studio 2.0 preview.

Instant Run is a new feature introduced in Android Studio 2.0.

ps: in case you don't find Instant run, its in:

Android Studio --> Preferences --> Build, execution, deploy --> Instant run.

or you can search for it in the preferences tab.

like image 25
dalizhang Avatar answered Nov 03 '22 17:11

dalizhang


Go to AVD Manager, then in the action section of your device select wipe data. This worked for me, hope it helps....

like image 24
Walter Torricos Avatar answered Nov 03 '22 15:11

Walter Torricos


This helped me for the emulator: Close Emulator. Tools > AVD Manager > Select Emulator Settings > Wipe Data > Cold Boot.. Now Install App.

Reference

like image 14
Murat Avatar answered Nov 03 '22 15:11

Murat