When I clean my project, I get the following error:
[2011-10-05 13:47:53 - The Basics] Dx trouble processing "java/nio/CharBuffer.class": Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library.
This often happens due to the unintentional inclusion of a core library file in your application when using an IDE (e.g. Eclipse). If you are sure that you are not intentionally defining the main class, then this is the most likely explanation for what is going on.
However, you can try to define a class in the kernel a namespace whose source you may have taken, for example, from a virtual machine project other than Android. This will most of all certainly not work. At a minimum, this compromises the compatibility of your application with future versions of the platform. It also often causes dubious legitimacy.
If you really want to create a core library that is only suitable as part of creating a complete distribution virtual machine, as opposed to compiling the application, then use the --core-library option to suppress this error message.
If you continue to use "--core-library", but actually creating the application, then warn that your application at some point will still not be able to build or run. Please be prepared for angry customers who, for example, find that your application stops functioning after updating their working system. You will be to blame for this problem.
If you legally use some kind of code that is in the main package, then the simplest safe alternative that you have is repackaging that code. That is, move the classes in question into your own package namespace. This means that they will never conflict with the main system classes. JarJar is a tool that can help you in this endeavor. If you find that you cannot do this, this indicates that the path you are following will ultimately lead to pain, suffering, grief, and crying.
[2011-10-05 13:47:53 - The Basics] Dx 1 error; aborting [2011-10-05 13:47:53 - The Basics] Conversion to Dalvik format failed with error 1
dalvik
James
source share