23

Everytime I want to run my Android application I get a error:

[2013-12-26 11:24:12 - Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
[2013-12-26 11:24:12 - Pk6.1.3] Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.

I deleted Android dependencies from project > properties > java build path > libraries. After I clean the project and not run it.

I modify project.properties file, target=android-19, and I run it, but I don't want to do this.

Are there other solutions to solved the problem?

Thanks.

twlkyao
  • 14,302
  • 7
  • 27
  • 44
liuj
  • 233
  • 1
  • 2
  • 5
  • 2
    It may help you http://stackoverflow.com/questions/19727915/android-dex-gives-a-bufferoverflowexception-when-building/19803777#19803777 – mridul Jan 20 '14 at 11:24

8 Answers8

53

from Eclipse:

First Right click on project and go to properties.

  1. Go to Java Build Path Screen (from left menu)

  2. Select Libraries Pane.

  3. Highlight Android dependencies

  4. Click Remove

  5. Click Ok.

enter image description here

j2emanue
  • 60,549
  • 65
  • 286
  • 456
  • For me i had set a project as a library and then unset it as a library from the GUI. Some reason eclipse did not update the java build path library area. – j2emanue Mar 28 '14 at 16:38
  • I see, I think I must have done the same thing then as I imported a library as a project. Thanks. – AfromanJ Mar 28 '14 at 16:51
  • +1 for nice one and analysis the main problem not for finding bye pass – Yogesh Tatwal May 01 '14 at 20:52
  • This solution works... but if you are using services in your app it may not compile. At least that appeared to be the problem for me. My solution was to change the min/target build version in the manifest to 19 `` and also the project name to "Android 4.4.2" under Project --> Properties --> Android – user1985189 Nov 05 '14 at 03:41
33

Right click your project → android tools → android support library.

it works for me :)

Muhammad Usman Ghani
  • 1,279
  • 13
  • 19
  • 1
    I want to add that then I selected the option to update the support library. Once I completed that process I was able to successfully build my project again. – Jazzmine Jan 28 '14 at 14:58
24
Right click your project - Properties - Android

and set Project Build Target version higher.

I have same problem and this works for me.

Newkie
  • 399
  • 2
  • 15
  • This would only help if you wanted to break compatibility with your existing targets. Not even sure if it really helps then, or if it just resets your build dependencies. – gnac Feb 18 '15 at 03:29
9

I was doing some mistake, now it is working fine for me.

Remove dependency from: Properties (Alt+Enter) -> Java build path -> libraries tab.

Fari
  • 575
  • 1
  • 4
  • 15
Rakesh
  • 2,732
  • 29
  • 28
8

Also check Make sure that the value of android:targetSdkVersion in AndroidManifest.xml matches target=android- in project.properties. If these two values are not the same, building with build tools version 19.0.0 will end in the BufferOverflowException. After That Clean Project it works :)

Muhammad Usman Ghani
  • 1,279
  • 13
  • 19
1

Right click your project

then android tools

then add support library...

done.

Waqleh
  • 9,741
  • 8
  • 65
  • 103
1

If you have other projects than the project you are running in the same workspace, then selected same target android version for all your project.

For doing this, go to project properties from eclipse, select Android and from the list choose appropriate android sdk version.

This works for me

0

I had to empty the "Name" field of the Application Attributes

Pete
  • 1,191
  • 12
  • 19