Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android dex gives a BufferOverflowException when building

Tags:

android

dex

No need to downgrade the build tools back to 18.1.11, this issue is fixed with build tools 19.0.1.

If you can't use 19.0.1 for some reason then:

Make sure that the value of android:targetSdkVersion in AndroidManifest.xml matches target=android-<value> in project.properties. If these two values are not the same, building with build tools version 19.0.0 will end in the BufferOverflowException. Source

There is also some indication from comments on this post that you need to target at least 19 (android-19). Please leave a comment if this solution also works if your target is < 19.

This is how the fix looks for my project. The related AOSP issue is #61710.

1 If you really need to downgrade, you don't need to uninstall build tools 19.0.0, simply install 18.1.1 and add sdk.buildtools=18.1.1 to the local.properties file.


Try what van said:

Right click your projectandroid toolsandroid support library.

Hope this helps :)


Same problem here. Reverted to build tools 18.1.1, restarted Eclipse and that fixed it.


I was able to get my problem project to build by adding this extra line:

sdk.build.tools=18.1.1

...to my project.properties file, which is present in the root of the project folder. All other approaches seemed to fail for me.


Right click on project >> Properties >> Android >> API Level 18 worked for me. But before I did that I did right click on project >> Android Tools >> Add Support Library and restarted Eclipse. You may have to play around with your selected API level.


After the installation of the new SDK, there is a new folder, "Android Dependencies", under your project file. If you right click and remove it from the build path, you will again be able to build your project.