Использование lambdaj в Android - PullRequest
12 голосов
/ 12 мая 2011

Кто-нибудь пробовал использовать библиотеку lambdaj в разработке под Android?

Это прекрасно работает для меня, когда я создаю простое маленькое Java-приложение, но мне не удается использовать его в Android-приложении.

UPDATE:

Я добавляю lambdaj (lambdaj-2.3.2-with-dependencies.jar, скачанный из http://code.google.com/p/lambdaj),, а затем при сборке приложения выдает следующую ошибку:

Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.hamcrest.generator.qdox.directorywalker.DirectoryScanner$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.

[2011-05-12 15:45:30 - MyAppName] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.hamcrest.generator.qdox.JavaDocBuilder$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.

[2011-05-12 15:45:30 - MyAppName] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.hamcrest.generator.qdox.junit.APITestCase$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.

[2011-05-12 15:45:30 - MyAppName] Dx 
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.cf.code.SimException: local variable type mismatch: attempt to set or access a value of type java.lang.Object using a local variable of type int. This is symptomatic of .class transformation tools that ignore local variable information.

...
skipped stack trace
...

...while working on block 001b

...while working on method yylex:()I

...while processing yylex ()I

...while processing org/hamcrest/generator/qdox/parser/impl/JFlexLexer.class

[2011-05-12 15:45:30 - MyAppName] Dx 1 error; aborting

[2011-05-12 15:45:30 - MyAppName] Conversion to Dalvik format failed with error 1

Ответы [ 2 ]

1 голос
/ 27 октября 2015

Я знаю, что этому вопросу уже 4 года, но у меня была та же проблема в настоящее время, и я решил, добавив к своим зависимостям конфигурации сборки gradle последнюю доступную версию библиотеки hamcrest.

здесь мой связанныйнить


ОБНОВЛЕНИЕ:

У меня возникли проблемы с lambdaj в моем проекте, эта библиотека не полностью совместима.Я перешел на retrolambda , зацените!

1 голос
/ 23 мая 2011

Мне кажется, что есть проблема с библиотекой hamcrest. Попробуйте следовать совету, приведенному в сообщении об ошибке, и пересоберите библиотеку hamcrest из исходного кода.

...