1

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)
Peterdeka
  • 387
  • 5
  • 19

1 Answers1

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.
Budius
  • 39,391
  • 16
  • 102
  • 144
  • i downloaded the jar with dependecies, put it in libs folder,right click and "add to buildpath"... anything else? – Peterdeka Apr 05 '13 at 14:39
  • the latest versions of the android ADT does not require you to `add to build path`. Just being inside the libs folder the plugin will 'grab it'. On the properties->java->build path->export make sure to check box for AndroidDependencies. (and if the .jar was added to the buildpath you can remove and just let the AndroidDepencies) – Budius Apr 05 '13 at 14:41
  • 1
    ok thanks a lot. but now i get this: 04-05 16:46:42.555: E/AndroidRuntime(8482): java.lang.ExceptionInInitializerError 04-05 16:46:42.555: E/AndroidRuntime(8482): at ch.lambdaj.proxy.ProxyUtil.createEnhancer(ProxyUtil.java:89) 04-05 16:46:42.555: E/AndroidRuntime(8482): at ch.lambdaj.proxy.ProxyUtil.createProxy(ProxyUtil.java:49) 04-05 16:46:42.555: E/AndroidRuntime(8482): at ch.lambdaj.function.argument.ArgumentsFactory.createPlaceholder(ArgumentsFactory.java:68) – Peterdeka Apr 05 '13 at 14:48
  • see. Now your library was successfully imported into the project. That error you're getting is something code related. – Budius Apr 05 '13 at 14:57
  • To answer the ExceptionInInitializerError question: LambdaJ apparently doesn't work on Android (http://stackoverflow.com/questions/16256395/lambdaj-fails-java-lang-exceptionininitializererror-with-any-call-on-android) – damaxxed Jan 02 '15 at 17:57