java - 在安卓中使用 lambdaj

标签 java android dependencies lambdaj

有人试过在android开发中使用lambdaj库吗?

当我创建一个简单的小型 java 应用程序时,它对我来说工作正常,但我无法在 android 应用程序中使用它。

更新:

我正在添加 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

最佳答案

我知道这个问题已有 4 年历史,但我现在遇到了同样的问题,我通过将最新的 hamcrest 库版本添加到我的 gradle 构建配置 depedencies 中解决了这个问题。

here my related thread


更新:

我在我的项目中遇到了 lambdaj 的问题,这个库不完全兼容。我搬到了 retrolambda,看看吧!

关于java - 在安卓中使用 lambdaj,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5977100/

相关文章:

android - 部署apk时出现重复文件

makefile - GNU 制作 : clean target depends on includes

java - PKCS11机制差异+JAVA

java - setHeader() 如何在 Apache Camel 中工作

java - Hibernate/JPA 处理空结果集

java - jackson 中用于枚举的自定义xml解串器

java - 拖放益智游戏的碰撞问题

java - 在 WebView [Android Studio] [Java] 中允许麦克风访问(权限)

java - 构建项目时实现新依赖项时,在模块classes.jar中发现重复的类

python - 如何为 python 代码做 Makefile 依赖