Window下采用ant 脚本构建Android自动化编译

1. http://ant.apache.org/ 下载最新的ant脚本s

2. android update project --name Tank -t 11 -p F:\tank 

3. 出现警告:编码 ascii 的不可映射字符错误编译乱码解决办法: 找到<sdkpath>\tools\ant\ant_rules_r3.xml。打开找到节点:<javac encoding="ascii" target="1.5" debug="true" extdirs="" ....> 把ascii改为gbk即可。 

以上都是 http://www.cnblogs.com/tankaixiong/archive/2010/11/24/1887156.html 获得。 我写该blog,目的是解决我们这样的问题: android项目依赖UserLibrary的问题。

<javac encoding="ascii" target="1.5" debug="true" extdirs="" destdir="${out.classes.absolute.dir}" 

bootclasspathref="android.target.classpath" verbose="${verbose}" classpath="${extensible.classpath}">

bootclasspathref定义如下

 <path id="myandroid.target.classpath">

  <pathelementlocation="${sdk.dir}/tools/android.jar" />

  <pathelementlocation="${sdk.dir}/tools/layoutlib.jar" />

 </path>

  然后将以上找到的节点改成如下 :

  <javac encoding="ascii" target="1.5" debug="true" extdirs="" destdir="${out.classes.absolute.dir}" 

  bootclasspathref="myandroid.target.classpath" verbose="${verbose}" classpath="${extensible.classpath}">

  讲过验证,没有问题。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值