Android: What is the folder name of the jar files (LIB or LIBS)?

后端 未结 3 1435
猫巷女王i
猫巷女王i 2020-12-01 12:38

I am going to create a library project which has several dependencies (jar files). I am confused because I\'ve seen some android projects which has LIB or LIBS folder under

相关标签:
3条回答
  • 2020-12-01 13:20

    Citing: http://tools.android.com/recent/dealingwithdependenciesinandroidprojects

    If you are still referencing jar libraries manually instead of putting them under libs/ be aware of the following:

    • If the project is a Library project, these jar libraries will not be automatically visible to application projects. You should really move these to libs/
    • If the project is an application, this can work but you must make sure to mark the jar files as exported.
    0 讨论(0)
  • 2020-12-01 13:21

    It doesn't matter actually. It can be lib or libs. Whether jar files are in lib or in libs, you just need to do right click on project, select "Build path => Add to build path" , thats it.

    0 讨论(0)
  • 2020-12-01 13:26

    If you use the Android command line to create your project, it'll default to libs/. It turns out that the Android Ant tasks are set to look in libs/ by default.

    See $ANDROID_HOME/tools/ant/main_rules.xml:

    <property name="jar.libs.dir" value="libs" />
    

    If you just care about Eclipse, you can use whatever you want.

    In newer revisions of ADT (revision 17 onwards), the Ant-based build system and the Eclipse plug-in are aligned so that they behave the same way. This means, by default, only the jars that are present in the libs folder are included in the final apk file. These jars would automatically appear under "Android Dependencies" in your Eclipse project.

    For more details please refer here. http://tools.android.com/recent/dealingwithdependenciesinandroidprojects

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