android-datepicker:UNEXPECTED TOP-LEVEL EXCEPTION:找不到classes.jar

时间:2013-07-06 19:51:10

标签: android ant dex android-simon-datepicker

我正在尝试将Simon的DatePicker lib项目(https://github.com/SimonVT/android-datepicker)包含在我自己的项目中。 README文件说它依赖于他的NumberPicker和CalendarView lib项目。所以我将所有三个项目放在我的项目目录中,在它们上面运行android update lib-project(我正在使用ant),添加NumberPicker和CalendarView库作为DatePicker lib和DatePicker lib的依赖项,作为我自己项目的依赖项。到目前为止一切都很好。它也编译,所以依赖似乎工作。但是当dexing开始时,我收到以下错误:

[dex] Converting compiled files and external libraries into /home/rogerrapid/MyProject/bin/classes.dex...
   [dx] 
   [dx] UNEXPECTED TOP-LEVEL EXCEPTION:
   [dx] java.io.FileNotFoundException: /home/rogerrapid/MyProject/android-datepicker/library/bin/classes.jar (No such file or directory)
   [dx]     at java.util.zip.ZipFile.open(Native Method)
   [dx]     at java.util.zip.ZipFile.<init>(ZipFile.java:214)
   [dx]     at java.util.zip.ZipFile.<init>(ZipFile.java:144)
   [dx]     at java.util.zip.ZipFile.<init>(ZipFile.java:158)
   [dx]     at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:206)
   [dx]     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
   [dx]     at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
   [dx]     at com.android.dx.command.dexer.Main.processOne(Main.java:422)
   [dx]     at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
   [dx]     at com.android.dx.command.dexer.Main.run(Main.java:209)
   [dx]     at com.android.dx.command.dexer.Main.main(Main.java:174)
   [dx]     at com.android.dx.command.Main.main(Main.java:91)
   [dx] 1 error; aborting

有谁知道如何解决这个问题?我想我一定是在忽略一些事情。我以前从未尝试过添加带有其他lib依赖项的android库。

1 个答案:

答案 0 :(得分:2)

从android-datepicker文件夹中检查project.properties,如果项目未标记为库,请使用 android.library = true 将项目标记为库...