How to include jar files in android library project

Ashok picture Ashok · Jan 2, 2012 · Viewed 9.6k times · Source

I am trying to use phonegap inside an android library project. The library project compiles just fine but when i try to start an activity that extends DroidGap, i get this error

01-02 10:12:17.575: W/dalvikvm(316): Unable to resolve superclass of Lcom/***/***.

I think this is because the phonegap.jar file is not included in the compiled jar file of the android library project. I have tried using ant to build but it doesn't seem to work.

Edit: I am building a android library that can be used in other android projects. I am using the standard android library project but activities in this lib project that extended DroidGap class in phonegap.jar are crashing with the above error.

Answer

ggomeze picture ggomeze · Oct 30, 2012

I´m afraid that is not possible yet. The result jar file will contain all classes and resources defined in the android library project, but will not include external jar files added to the build path. You will have to add those to your final Android Projects using that library. You can also find similar questions in SO like this one