12

Am continuously getting, this errors in logcat

 DexOpt: not resolving ambiguous class 'Lorg/apache/http/client/utils/URLEncodedUtils;'
    12-07 05:26:01.085: ERROR/dalvikvm(4620): LinearAlloc exceeded capacity (5242880), last=1092
    12-07 05:26:01.085: ERROR/dalvikvm(4620): VM aborting
    12-07 05:26:01.187: INFO/DEBUG(2373): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    12-07 05:26:01.187: INFO/DEBUG(2373): Build fingerprint: 'samsung/SGH-T849/SGH-T849/SGH-T849:2.2/FROYO/UVJJB:user/release-keys'
    12-07 05:26:01.187: INFO/DEBUG(2373): pid: 4620, tid: 4620  >>> /system/bin/dexopt <<<
    12-07 05:26:01.187: INFO/DEBUG(2373): signal 11 (SIGSEGV), fault addr deadd00d
............etc
12-07 05:26:01.347: INFO/dalvikvm(2494): threadid=3: reacting to signal 3
12-07 05:26:01.358: INFO/dalvikvm(2494): Wrote stack traces to '/data/anr/traces.txt'
12-07 05:26:01.551: INFO/dalvikvm(2578): threadid=3: reacting to signal 3
12-07 05:26:02.866: ERROR/dalvikvm(4581): Failed to write stack traces to /data/anr/traces.txt (1370 of 2089): No such file or directory
12-07 05:26:25.976: ERROR/installd(2383): dexopt failed on '/data/dalvik-cache/data@app@com.check.careerbuilder-1.apk@classes.dex' res = 11
12-07 05:26:26.050: WARN/PackageManager(2494): Package couldn't be installed in /data/app/com.check.careerbuilder-1.apk

and While at Console

 Installation error: INSTALL_FAILED_DEXOPT
                     Please check logcat output for more details.
                     Launch canceled!

I tried, cleaning the project, restarting device, adb killing and starting server,

and I found WipeUserData to be checked , but how to wipeuserdata for realdevice?

How to resolve this issue and install my apk on samsung tablet?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Uday
  • 5,933
  • 9
  • 44
  • 76
  • This should solve the problem !!! [http://stackoverflow.com/a/13556519/2519412][1] [1]: http://stackoverflow.com/a/13556519/2519412 – shimi_tap Feb 11 '14 at 09:36

2 Answers2

7

It's a limitation in Dalvik triggered on unusually complex interface hierarchies.

http://code.google.com/p/android/issues/detail?id=22586

See the details for ideas on working around. Simple answer might be to try using different libraries that are less complex.

A fix has been merged into Android AOSP. https://android-review.googlesource.com/#/c/30900/

Mark Renouf
  • 30,697
  • 19
  • 94
  • 123
  • 2
    Does anybody know if there are workarounds to this aside from switching libraries? – Roberto Andrade Oct 03 '13 at 19:35
  • 1
    I'd be interested in a solution, too – Goddchen Nov 09 '13 at 18:33
  • I don't have a particularly complex app, but it is using Play Services, support, appcompat and the google-api-client libraries and it is running into this problem. Is there some way to analyse where the main culprit(s) are? Maybe then I could excise or mitigate them. – William Aug 30 '14 at 04:31
  • @William I am also facing similar problem did you get any workaround? Please tell me. Thanks. – Programmer Apr 11 '15 at 16:35
  • @Programmer see my answer http://stackoverflow.com/a/25579536/493682. If you use Proguard to trim away any unnecessary classes you can reduce yourself below the limit. – William Apr 12 '15 at 01:09
  • I have enabled Proguard. But still I am getting this error. My apk size is only 7.3 MB. This problem is occurred since I added new Google Cloud Module. Please look into my detailed question at http://stackoverflow.com/questions/29577329/installation-failed-since-the-device-possibly-has-stale-dexed-jars-that-dont-ma. Please help me to solve this problem. Thanks. – Programmer Apr 12 '15 at 08:37
1

One potential solution is to use Proguard to trim any unused method/classes from your app.

If you are using libraries this can quite significantly cut down the size of the app and the number of objects that need to be allocated thereby sidestepping the problem (at least up to a certain size app).

William
  • 20,150
  • 8
  • 49
  • 91