android-datepicker: UNEXPECTED TOP-LEVEL EXCEPTION: classes.jar not found

只愿长相守 提交于 2019-12-20 03:19:47

问题


I'm trying to include Simon's DatePicker lib project (https://github.com/SimonVT/android-datepicker) in my own project. The README file says it depends on both his NumberPicker and CalendarView lib projects. So I placed all three projects in my project dir, ran android update lib-project on them (I'm using ant), added the NumberPicker and CalendarView libs as dependencies of the DatePicker lib and the DatePicker lib as a dependency of my own project. Up until now all is well. It also compiles, so the dependencies seem to work. But when the dexing starts, I get the following error:

[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

Does anyone know how to solve this? I guess I must be overlooking something. I've never tried adding an android library with other lib dependencies before.


回答1:


check in the project.properties from android-datepicker folder, if the project isn't mark as a library, use android.library=true to mark the project as library...



来源:https://stackoverflow.com/questions/17506525/android-datepicker-unexpected-top-level-exception-classes-jar-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!