Lambdaj NoClassDefFoundError on android

孤街醉人 提交于 2019-12-11 14:07:46

问题


I'm trying out lambdaj in my android app but even the simplest filtering operations fail with the exception listed. For example:

Group<Person> groupedPersons= group(people,by(on(Person.class).getAge()));

and any other select or filter ends up with the same following exception, any idea? The "Person" class is a greenDAO class if it could be related..... thanks

04-05 16:07:48.735: E/AndroidRuntime(6579): FATAL EXCEPTION: main
04-05 16:07:48.735: E/AndroidRuntime(6579): java.lang.NoClassDefFoundError:ch.lambdaj.function.argument.ProxyArgument
04-05 16:07:48.735: E/AndroidRuntime(6579):     at ch.lambdaj.function.argument.ArgumentsFactory.createPlaceholder(ArgumentsFactory.java:68)
04-05 16:07:48.735: E/AndroidRuntime(6579):     at ch.lambdaj.function.argument.ArgumentsFactory.registerNewArgument(ArgumentsFactory.java:58)
04-05 16:07:48.735: E/AndroidRuntime(6579):     at ch.lambdaj.function.argument.ArgumentsFactory.createArgument(ArgumentsFactory.java:50)
04-05 16:07:48.735: E/AndroidRuntime(6579):     at ch.lambdaj.function.argument.ArgumentsFactory.createArgument(ArgumentsFactory.java:39)
04-05 16:07:48.735: E/AndroidRuntime(6579):     at ch.lambdaj.Lambda.on(Lambda.java:63)

回答1:


This exception is because the library was not included the generated android app (.apk file).

To fix it, there's nothing to do on how your code is written, but about your project settings.

  • If you're including it as a .jar file, make sure that the file is in the libs folder.
  • If you're including it as the whole project, make sure to include the project in the Export in the Java Build path in the Project Properties.


来源:https://stackoverflow.com/questions/15836231/lambdaj-noclassdeffounderror-on-android

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