我正在尝试使用ANT通过命令行编译我的安卓程序。并且代码编译良好。但是当执行目标-dex
时,我收到以下错误:
[dex] input: /Users/aditya/Desktop/workspace/Java/Play/bin/classes
[dex] input: /Library/Java/Android/tools/support/annotations.jar
[dex] Using Pre-Dexed annotations-5bd0afe28d834ceff67df1063f0f145b.jar <- /Library/Java/Android/tools/support/annotations.jar
[dex] Converting compiled files and external libraries into /Users/aditya/Desktop/workspace/Java/Play/bin/classes.dex...
[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
[dx] at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
[dx] at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
[dx] at com.android.dx.command.dexer.Main.processClass(Main.java:665)
[dx] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
[dx] at com.android.dx.command.dexer.Main.access$600(Main.java:78)
[dx] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[dx] at com.android.dx.command.dexer.Main.processOne(Main.java:596)
[dx] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:230)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:199)
[dx] at com.android.dx.command.Main.main(Main.java:103)
[dx] ...while parsing com/adi/play/BuildConfig.class
[dx]
[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
[dx] at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
[dx] at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
[dx] at com.android.dx.command.dexer.Main.processClass(Main.java:665)
[dx] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
[dx] at com.android.dx.command.dexer.Main.access$600(Main.java:78)
[dx] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[dx] at com.android.dx.command.dexer.Main.processOne(Main.java:596)
[dx] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:230)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:199)
[dx] at com.android.dx.command.Main.main(Main.java:103)
[dx] ...while parsing com/adi/play/PlayActivity$1.class
[dx]
[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
[dx] at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
[dx] at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
[dx] at com.android.dx.command.dexer.Main.processClass(Main.java:665)
[dx] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
[dx] at com.android.dx.command.dexer.Main.access$600(Main.java:78)
[dx] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[dx] at com.android.dx.command.dexer.Main.processOne(Main.java:596)
[dx] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:230)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:199)
[dx] at com.android.dx.command.Main.main(Main.java:103)
[dx] ...while parsing com/adi/play/PlayActivity$2.class
[dx]
[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
[dx] at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
[dx] at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
[dx] at com.android.dx.command.dexer.Main.processClass(Main.java:665)
[dx] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
[dx] at com.android.dx.command.dexer.Main.access$600(Main.java:78)
[dx] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[dx] at com.android.dx.command.dexer.Main.processOne(Main.java:596)
[dx] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:230)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:199)
[dx] at com.android.dx.command.Main.main(Main.java:103)
[dx] ...while parsing com/adi/play/PlayActivity.class
[dx]
[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
[dx] at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
[dx] at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
[dx] at com.android.dx.command.dexer.Main.processClass(Main.java:665)
[dx] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
[dx] at com.android.dx.command.dexer.Main.access$600(Main.java:78)
[dx] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[dx] at com.android.dx.command.dexer.Main.processOne(Main.java:596)
[dx] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:230)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:199)
[dx] at com.android.dx.command.Main.main(Main.java:103)
[dx] ...while parsing com/adi/play/R$attr.class
[dx]
[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
[dx] at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
[dx] at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
[dx] at com.android.dx.command.dexer.Main.processClass(Main.java:665)
[dx] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
[dx] at com.android.dx.command.dexer.Main.access$600(Main.java:78)
[dx] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[dx] at com.android.dx.command.dexer.Main.processOne(Main.java:596)
[dx] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:230)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:199)
[dx] at com.android.dx.command.Main.main(Main.java:103)
[dx] ...while parsing com/adi/play/R$drawable.class
[dx]
[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
[dx] at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
[dx] at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
[dx] at com.android.dx.command.dexer.Main.processClass(Main.java:665)
[dx] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
[dx] at com.android.dx.command.dexer.Main.access$600(Main.java:78)
[dx] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[dx] at com.android.dx.command.dexer.Main.processOne(Main.java:596)
[dx] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:230)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:199)
[dx] at com.android.dx.command.Main.main(Main.java:103)
[dx] ...while parsing com/adi/play/R$id.class
[dx]
[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
[dx] at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
[dx] at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
[dx] at com.android.dx.command.dexer.Main.processClass(Main.java:665)
[dx] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
[dx] at com.android.dx.command.dexer.Main.access$600(Main.java:78)
[dx] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[dx] at com.android.dx.command.dexer.Main.processOne(Main.java:596)
[dx] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:230)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:199)
[dx] at com.android.dx.command.Main.main(Main.java:103)
[dx] ...while parsing com/adi/play/R$layout.class
[dx]
[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
[dx] at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
[dx] at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
[dx] at com.android.dx.command.dexer.Main.processClass(Main.java:665)
[dx] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
[dx] at com.android.dx.command.dexer.Main.access$600(Main.java:78)
[dx] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[dx] at com.android.dx.command.dexer.Main.processOne(Main.java:596)
[dx] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:230)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:199)
[dx] at com.android.dx.command.Main.main(Main.java:103)
[dx] ...while parsing com/adi/play/R$string.class
[dx]
[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
[dx] at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
[dx] at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
[dx] at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
[dx] at com.android.dx.command.dexer.Main.processClass(Main.java:665)
[dx] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
[dx] at com.android.dx.command.dexer.Main.access$600(Main.java:78)
[dx] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
[dx] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[dx] at com.android.dx.command.dexer.Main.processOne(Main.java:596)
[dx] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:230)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:199)
[dx] at com.android.dx.command.Main.main(Main.java:103)
[dx] ...while parsing com/adi/play/R.class
[dx]
[dx] 10 errors; aborting
BUILD FAILED
/Library/Java/Android/tools/ant/build.xml:899: The following error occurred while executing this line:
/Library/Java/Android/tools/ant/build.xml:901: The following error occurred while executing this line:
/Library/Java/Android/tools/ant/build.xml:913: The following error occurred while executing this line:
/Library/Java/Android/tools/ant/build.xml:294: null returned: 1
我在Gradle和IntelliJ上遇到了同样的错误。
我无法弄清楚实际问题发生了什么。请帮忙。我正在使用Java 1.8来编译这个程序。有没有办法使用 Java 1.8 来做到这一点?有必要使用 1.6 吗?如果是这样,我应该如何使用Java 1.6?
检查您用于编译类的 Java 版本。
您需要使用 Java 6 或 7 进行 Android 开发。Java 7 支持是最近添加的,其功能有限,因此请使用 6 以获得最大的兼容性。
这个问题的原因是Java版本。它应该是 jdk 1.7 或更低。卸载 1.8 版本并安装 1.7 并更改环境变量中的路径。