安卓包含的.jar蚂蚁编译 [英] Android include .jar in ant compilation

查看:119
本文介绍了安卓包含的.jar蚂蚁编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着在我的应用程序编译成包括的.jar编译。

I try to include in my application compilation a .jar compiled.

我使用Ant编译我的Andr​​oid应用程序。

I use ant to compile my Android application.

当我加入这个任务到build.xml:

When I add this task to build.xml :

 <javac srcdir="${src}"
     classpath="xyz.jar" />

编译失败的Andr​​oid包输入:

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脚本的Andr​​oid创建项目,那么你应该能够转储在目录的任何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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆