【发布时间】:2014-06-04 21:49:52
【问题描述】:
有没有办法,如何将自定义库添加到 android 应用程序。如果我将非 android 库添加到我的项目中,则会抛出错误“只有 Android 项目可以添加为依赖项”,如果我将 Android 库引用到 Java 应用程序,则会抛出“无法添加此项目,因为它不会使用蚂蚁脚本。”关键是,我想将代码保存在一个地方(库)并重用它。
【问题讨论】:
标签: java android ant dependencies libraries
有没有办法,如何将自定义库添加到 android 应用程序。如果我将非 android 库添加到我的项目中,则会抛出错误“只有 Android 项目可以添加为依赖项”,如果我将 Android 库引用到 Java 应用程序,则会抛出“无法添加此项目,因为它不会使用蚂蚁脚本。”关键是,我想将代码保存在一个地方(库)并重用它。
【问题讨论】:
标签: java android ant dependencies libraries
你最好的选择是:
1.Create a folder called libs in your project's root folder
2.Copy your JAR files to the libs folder
3.Now right click on the Jar file and then select Build Path > Add to Build Path, which will create a folder called 'Referenced Libraries' within your project
【讨论】: