2 lj317 lj317 于 2013.12.10 15:16 提问

构建时的UNEXPECTED TOP-LEVEL EXCEPTION异常

使用hudson进行android项目的构建时,在执行ant脚本到dex标签时,出现如下错误:

dex:
 [echo] Converting compiled files and external libraries into bin/classes.dex...
[apply]
[apply] UNEXPECTED TOP-LEVEL EXCEPTION:
[apply] com.android.dex.util.ExceptionWithContext
[apply]     at com.android.dex.util.ExceptionWithContext.withContext(ExceptionWithContext.java:45)
[apply]     at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:377)
[apply]     at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:139)
[apply]     at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:94)
[apply]     at com.android.dx.command.dexer.Main.processClass(Main.java:682)
[apply]     at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
[apply]     at com.android.dx.command.dexer.Main.access$600(Main.java:78)
[apply]     at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
[apply]     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)
[apply]     at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[apply]     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[apply]     at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[apply]     at com.android.dx.command.dexer.Main.processOne(Main.java:596)
[apply]     at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
[apply]     at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
[apply]     at com.android.dx.command.dexer.Main.run(Main.java:230)
[apply]     at com.android.dx.command.dexer.Main.main(Main.java:199)
[apply]     at com.android.dx.command.Main.main(Main.java:103)
[apply] Caused by: java.lang.NullPointerException
[apply]     at com.android.dx.cf.code.ConcreteMethod.<init>(ConcreteMethod.java:87)
[apply]     at com.android.dx.cf.code.ConcreteMethod.<init>(ConcreteMethod.java:75)
[apply]     at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:277)
[apply]     ... 16 more
[apply] ...while processing run ()V
[apply] ...while processing ji$1.class

求大神帮助,在线等。谢谢

1个回答

qq_27815979
qq_27815979   2015.09.14 15:39

一般是各模块引用了相同的jar包的不同的版本引起的,统一版本即可。

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!