I've been able to get external JARs for common code (which uses the
android.jar) to work. I'm using a pretty clumsy way and I'm sure
there's a more elegant solution out there, but it works for me.

Since it's been a while since I set it up, I might not remember the
exact steps. Basically, I created a new Java project (I forgot which
option precisely I used), but it's not an Android-specific project -
it does not have the Android builders.

In the project's settings, I added android.jar as an external JAR in
the Java Build Path.

With that, I'm able to write code that uses the Android SDK which is
compiled and error-checked as I type. Now here is the clumsy part.

When I want to use it in my actual project, I choose File (or right-
click) -> Export -> Java/JAR File.
Now pick a good place for the .jar file in your repository and export
it. Good news is that Eclipse remembers your settings, so every time
you export, you basically just need to click on Next and Finish.

In your actual Android app, go to the project properties, Java Build
Path, Libraries, and add your .jar file as an external JAR. Now here
is the part that sucks: Every time you change your library, you'll
need to re-export it, then click on the jar in the package explorer,
right-click it and choose "Refresh".

Other than that, this works like a charm for me. Again, I'm sure
people who are more familiar with Eclipse are scoffing and have a much
better solution.


On Jan 10, 4:25 pm, gymshoe <gyms...@bresnan.net> wrote:
> 1) I think this problem is solely related to using external JAR's.
> I tried to do reference an external JAR for the first time, and got
> exactly the same error.  If you have solved this issue, please post.
>
> 2) Sorry, don't know  about this.
>
> Thanks,
> JIm
>
> On Nov 19 2008, 2:50 pm, Alvin Yates <mamboth...@gmail.com> wrote:
>
> > I'm making a new project where I'm attempting to share onlycommon
> > Javacode(i.e. no Android classes used) that handle boring stuff like
> > data structures, data formatting, and XML parsing from my previous
> > Android app.  You know, stuff that I would eventually like to go back
> > and refactor to be properly done.
>
> > I had an issue with making anEclipselibrary and importing that into
> > a project (Runtime validation errors, which I solved by importing each
> > JAR file for HTTP MIME separately), and I seem to be having an equally
> > lame issue right now.  Adding the previous project's source to my
> > build path gives this error:
>
> > [2008-11-19 12:24:58 - Dex Loader] Unable to execute dex: null
> > [2008-11-19 12:24:58 - MyApp] Conversion to Dalvik format failed:
> > Unable to execute dex: null
>
> > So a few questions come to mind:
>
> > 1) What is this error referring to?  Is this a problem with my
> > Manifest (which is in a different library), or a limitation on how 
> > theEclipseplug-in works with the DVM?
>
> > And the more general...
>
> > 2) Is creating usercommoncodepossible withinEclipsesuch that
> > Dalvik will not cause some error in compile/runtime validation?
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to