我在 Eclipse 中有一个 Android 项目,我想将其转换为使用Ant构建。
我怎样才能做到这一点?我曾尝试导出一个 Ant 构建文件,但我很确定这不起作用(在使用导出的文件运行 ant 时也不行)。我对 Ant 也不太了解,所以一些解释也会有所帮助。
编辑:现在我似乎已经设法创建了所需的构建文件,但我需要添加项目库,如 admob.jar 以供 ant 看到并用于构建。因为我收到以下错误
-dex:
[echo] Converting compiled files and external libraries into C:\Users\Jason
\Documents\Programming\Android\Android SVN\trunk\GPSAlarm\BusSnooze\bin\classes.
dex...
[apply]
[apply] UNEXPECTED TOP-LEVEL EXCEPTION:
[apply] com.android.dx.util.ExceptionWithContext
[apply] at com.android.dx.util.ExceptionWithContext.withContext(Exceptio
nWithContext.java:46)
[apply] at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslato
r.java:340)
[apply] at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.ja
va:131)
[apply] at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.jav
a:85)
[apply] at com.android.dx.command.dexer.Main.processClass(Main.java:297)
[apply] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:
276)
[apply] at com.android.dx.command.dexer.Main.access$100(Main.java:56)
[apply] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.jav
a:228)
[apply] at com.android.dx.cf.direct.ClassPathOpener.processArchive(Class
PathOpener.java:245)
[apply] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPath
Opener.java:130)
[apply] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpe
ner.java:108)
[apply] at com.android.dx.command.dexer.Main.processOne(Main.java:245)
[apply] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:1
83)
[apply] at com.android.dx.command.dexer.Main.run(Main.java:139)
[apply] at com.android.dx.command.dexer.Main.main(Main.java:120)
[apply] at com.android.dx.command.Main.main(Main.java:87)
[apply] Caused by: java.lang.NullPointerException
[apply] at com.android.dx.cf.code.ConcreteMethod.<init>(ConcreteMethod.j
ava:84)
[apply] at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslato
r.java:243)
[apply] ... 14 more
[apply] ...while processing <init> ()V
[apply] ...while processing com/google/android/apps/analytics/AnalyticsRecei
ver.class
[apply]
[apply] 1 error; aborting