OK, I finally figured it out. For the record, in case anybody else needs to do this: I had to go Project Properties -> Projects -> Required projects on the build path, and add the dependency there. It turns out that the external classfiles are, in fact, being added to classes.dex and the .apk.
Debugging this in my case was confounded by the fact that I was inflating some custom classes in layout/main.xml and there was a typo in the classname that wasn't being picked up until runtime, and I didn't notice the typo. On Jan 29, 11:35 pm, luke <[email protected]> wrote: > Actually I spoke too soon -- I didn't get to test this when I replied > beyond just seeing that my compile errors disappeared. > > When I add external projects or external class folders to the build > path, Eclipse can find the external classes just fine. But when I > launch as an Android app, the Dalvik classloader says it can't find > the external classes. > > Is there anything else I have to do to have external classes copied > across into the .apk when Android apps are compiled? I'd rather avoid > adding custom ant build steps if possible... > > On Jan 20, 8:04 pm, jtaylor <[email protected]> wrote: > > > Try Java Build Path > Libraries > Add External Class Folder. > > > - Juan T. > > > On Jan 20, 12:29 pm, luke <[email protected]> wrote: > > > > I have two projects that share classes in a third project. Eclipse > > > happily allows me to reference these external classes when I am > > > developing the two dependant projects (as long as the Java Build Path > > > is set up right), but when I try launching the dependant projects, the > > > external classfiles are not copied into the .apk for some reason, so > > > at runtime I get unsatisfied link errors. I don't want to have to > > > maintain multiple copies of the same source file, or even have a copy > > > of these external classfiles in the dependant projects. I also want > > > to avoid adding an extra build step where I build the external > > > classfiles, package them up in a .jar file and include them in the > > > dependant projects. > > > > How can I get the Android SDK to simply put a copy of any referenced > > > (non-SDK, non-project) external classes in the .apk at build time? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

