Java Library in an Android library referenced by an Android Project throws NoClassDefFound

前端 未结 1 488
自闭症患者
自闭症患者 2021-01-21 19:39

I have an Android library project (written by me and I have the sources) which I use in my Android project - so far so good and no problems. But in that library project I am ref

相关标签:
1条回答
  • 2021-01-21 20:31

    Check out the official dev guide here:

    A library project can include a JAR library
    You can develop a library project that itself includes a JAR library, however you need to manually edit the dependent application project's build path and add a path to the JAR file.

    Besides the library project, you need manually add the jar to your main project build path as well, hope this help.

    Update from SDK r17:

    This is automatically handled by ADT now, check out new feature for ADT 17.0.0 release here:

    Added feature to automatically setup JAR dependencies. Any .jar files in the /libs folder are added to the build configuration (similar to how the Ant build system works). Also, .jar files needed by library projects are also automatically added to projects that depend on those library projects. (more info)

    0 讨论(0)
提交回复
热议问题