1

I download an android project source code from github and open it with Android Studio, but when I click the "run app" button, after some while I got this error:

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?

And I got this error in the console

$ adb push D:\work\zuoyexitong\third-part-projects\AndroidAudioRecorder\app\build\outputs\apk\app-debug.apk /data/local/tmp/cafe.adriel.androidaudiorecorder.example
$ adb shell pm install -r "/data/local/tmp/cafe.adriel.androidaudiorecorder.example"
    pkg: /data/local/tmp/cafe.adriel.androidaudiorecorder.example
Failure [INSTALL_FAILED_DEXOPT]

But I'm sure I didn't install this apk before. And if I click "ok" to let Android Studio to uninstall the app, i got this error

$ adb shell pm uninstall cafe.adriel.androidaudiorecorder.example
Unknown failure (Failure)
Error while Installing APK

My Android Stuido Version is : 2.2.3 .

The project i use is here

My device's android version is 4.1.1 .

My problem looks like this and this , but they can't solve my problem.

So how to solve this problem?

Community
  • 1
  • 1
BHawK
  • 13
  • 1
  • 5

3 Answers3

1

Try turning off Instant Run in Android Studio: File / Settings / Build, Execution, Deployment / Instant Run / uncheck the top box.

If this allows successful installs, then turn instant run back on, and see if the problem comes back. It did for me - I just hit this issue on a small test program at AS2.4P7. The instant run feature is a light switch -on gives this error (even after refactoring) - off and the app loads OK. If it problem comes back when you turn on instant run again, then file a bug report - Help / Report Instant Run Issue...

Jim Andreas
  • 1,557
  • 1
  • 17
  • 29
0

This message is because there is an old version of your app installed on the device that has a dex size different from the current one you are trying to install, so you should press OK and proceed!

But I'm sure I didn't install this apk before.

Check if you are using the same package name of another app that is installed on your device [most probably by you]!

Atef Hares
  • 4,715
  • 3
  • 29
  • 61
  • Thanks for your reply, I have add some info of my question, this maybe helpful to description my question. And I am really sure I didn't install this app before. – BHawK Mar 03 '17 at 05:20
0

check you have space left for app install. Try uninstalling some apps and try this app install.

Deep P
  • 557
  • 5
  • 12
  • Thanks Deep, but the space of my device that I can use to install app is almost 3.5GB, I got this info from Settings app. – BHawK Mar 03 '17 at 05:22