Friday, December 13, 2013

Android Programming Tips : Error Unable to Execute Dex When Run a Project

Today I tried to download open source android project source code from the internet. I use Eclipse as my IDE and tried to import the project to Eclipse. Everything worked fine until I tried to execute and run this project. The IDE quickly told me that there is an error in my project and 2 line of error message in console log as bellow:

[2013-12-13 21:04:48 - Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.
[2013-12-13 21:04:48 - xxxxxx] Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.

But I couldn't find any error in the source code. So I thought this was a configuration error. And here were the way I solved it :

  1. Right click on your project.
  2. Select Android Tools -> Add Support Library
  3. There was a process running for a while, and then tried to run the project once more, and It worked well. Viola!!
Please comment if you find this tips useful. :D

Finally, C# 9 record, the equivalent of Scala's case class

While C# is a wonderful programming language, there is something that I would like to see to make our life programmer easier. If you are fam...