10

I am working with ccr4j API in Android so when I run my project its thrown an error like:
Error while installing application (INSTALL_FAILED_DEXOPT)

I find from net and same site also, did all trying like,
1. Uninstalled same application from device.
2. Run Emulator with Wipe User Data.
But still same error comes.

So anyone know why its thrown this kind of error?

dakshbhatt21
  • 3,558
  • 3
  • 31
  • 40
PrashantAdesara
  • 1,897
  • 3
  • 22
  • 41

3 Answers3

8

This most likely has to do with the size of classes.dex. On anything pre-ICS dexopt will fail on anything over 5mb. Check the size of classes.dex in your apk. It would also be good to see what your method count is as dex has a 65536 method/field limit.

Jared Rummler
  • 37,824
  • 19
  • 133
  • 148
  • Thank you so much ! I couldn't find a solution then I saw your answer. I deleted some unused libs in /libs folder and other libraries linked to the project and now it's working. I will use Proguard later with that application when I'll get some time – Seb83 Apr 25 '14 at 12:37
4

I have same problem. Checked classes.dex file and it is about 7mb's. I'll try to find a solution. I hope Facebook's solution solves mine too.
By the way thanks for information @Jared.
https://www.facebook.com/notes/facebook-engineering/under-the-hood-dalvik-patch-for-facebook-for-android/10151345597798920

Edit 1: I've solved this problem by using proguard optimization. My previous classes.dex file was about 7mb, and after proguard optimization it became 4mb. And now I can run this obfuscated and optimized apk on 2.2 and 2.3 devices.

Edit 2: Official Google Multi Dex support is the best solution for this issue. https://developer.android.com/tools/building/multidex.html

Devrim
  • 15,345
  • 4
  • 66
  • 74
0

Find Android SDK folder. (Usually C:\User\AppData\Local\Android\sdk) Delete folders which starts with dot(.), they are temporary downloads files. Then delete Android Emulator from SDK Manager. Then run Android Studio as administrator and then download and install Android Emulator again. And make sure you have installed Intel H.A.X.M.. Now you can create emulator and use it without errors.

Samir Alakbarov
  • 1,120
  • 11
  • 21