安卓包含的.jar蚂蚁编译 [英] Android include .jar in ant compilation
问题描述
我试着在我的应用程序编译成包括的.jar编译。
I try to include in my application compilation a .jar compiled.
我使用Ant编译我的Android应用程序。
I use ant to compile my Android application.
当我加入这个任务到build.xml:
When I add this task to build.xml :
<javac srcdir="${src}"
classpath="xyz.jar" />
编译失败的Android包输入:
compilation failed on android package importation :
[javac] Compiling 1 source file
[javac] C:\HelloWorld\src\com\example\hellowolrd\HelloWorld.java:3: package android.app does not exist
[javac] import android.app.Activity;
[javac] ^
而当我的任务是不是在build.xml文件,编译成功了。
Whereas when my task was not in build.xml, compilation succeeded.
推荐答案
如果您使用的是由标准ant脚本的Android创建项目
,那么你应该能够转储在库
目录的任何jar包,并让它们自动包含(<一href="http://developer.android.com/guide/developing/projects/index.html#ApplicationProjects">documentation).
If you're using the standard ant script from android create project
then you should be able to dump any jars in a libs
directory and have them included automatically (documentation).
这篇关于安卓包含的.jar蚂蚁编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!