使用 ant debug 在命令行中构建并运行具有子项目的 android 项目 [英] build and run android project having a subproject in command line using ant debug

查看:27
本文介绍了使用 ant debug 在命令行中构建并运行具有子项目的 android 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从命令行构建一个 android 项目.我的 android 项目在我的主 android 项目中有一个子项目.当我运行 ant debug 命令时,它显示在构建类时出错,因为未从子项目中找到库类.所以我认为子项目没有正确包含,我们需要为此执行一些命令.

I am trying to buil an android project from command line. My android project has a sub project inside my main android project. When I run the ant debug command it showing error in building classes as not found the library classes from the subproject. So I think the sub project is not included correctly, we need to execute some command for that.

请帮忙,提前致谢

推荐答案

我从Android官方文档中得到了答案:

I got the answer from Android official doc:

android update lib-project --target 3 --path ZBarScanner-master/ZBarScannerLibrary 
android update project --name android_app --path . --library ZBarScanner-master/ZBarScannerLibrary 

首先我们需要更新库项目,然后更新主项目.两者都应该在进行更新之前创建.然后做:

First we need to update the library project and then update the main project. Both should be created before doing the update. Then do:

ant clean 
ant debug

这篇关于使用 ant debug 在命令行中构建并运行具有子项目的 android 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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