- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在尝试使用 retrolambda连同 gradle-retrolambda插入。一般来说它工作正常,但是当我编译发布时,lint
阶段失败并出现异常:
:playground.dagger:lintVitalReleaseFailed converting ECJ parse tree to Lombok for file D:\....\playground\dagger\MainActivity.java
java.lang.UnsupportedOperationException: Unknown ASTNode child: LambdaExpression
at lombok.ast.ecj.EcjTreeVisitor.visitOther(EcjTreeVisitor.java:368)
at lombok.ast.ecj.EcjTreeVisitor.visitEcjNode(EcjTreeVisitor.java:364)
at lombok.ast.ecj.EcjTreeConverter.visit(EcjTreeConverter.java:295)
at lombok.ast.ecj.EcjTreeConverter.toTree(EcjTreeConverter.java:236)
at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:282)
at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:252)
at lombok.ast.ecj.EcjTreeConverter.access$100(EcjTreeConverter.java:141)
at lombok.ast.ecj.EcjTreeConverter$2.visitMessageSend(EcjTreeConverter.java:1042)
at lombok.ast.ecj.EcjTreeVisitor.visitEcjNode(EcjTreeVisitor.java:156)
at lombok.ast.ecj.EcjTreeConverter.visit(EcjTreeConverter.java:295)
at lombok.ast.ecj.EcjTreeConverter.toTree(EcjTreeConverter.java:236)
at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:282)
at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:252)
at lombok.ast.ecj.EcjTreeConverter.toBlock(EcjTreeConverter.java:397)
at lombok.ast.ecj.EcjTreeConverter.access$1500(EcjTreeConverter.java:141)
at lombok.ast.ecj.EcjTreeConverter$2.visitMethodDeclaration(EcjTreeConverter.java:1241)
at lombok.ast.ecj.EcjTreeVisitor.visitEcjNode(EcjTreeVisitor.java:152)
at lombok.ast.ecj.EcjTreeConverter.visit(EcjTreeConverter.java:295)
at lombok.ast.ecj.EcjTreeConverter.toTree(EcjTreeConverter.java:236)
at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:282)
at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:252)
at lombok.ast.ecj.EcjTreeConverter.access$100(EcjTreeConverter.java:141)
at lombok.ast.ecj.EcjTreeConverter$2.createNormalTypeBody(EcjTreeConverter.java:563)
at lombok.ast.ecj.EcjTreeConverter$2.visitTypeDeclaration(EcjTreeConverter.java:486)
at lombok.ast.ecj.EcjTreeVisitor.visitEcjNode(EcjTreeVisitor.java:48)
at lombok.ast.ecj.EcjTreeConverter.visit(EcjTreeConverter.java:295)
at lombok.ast.ecj.EcjTreeConverter.toTree(EcjTreeConverter.java:236)
at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:282)
at lombok.ast.ecj.EcjTreeConverter.fillList(EcjTreeConverter.java:252)
at lombok.ast.ecj.EcjTreeConverter.access$100(EcjTreeConverter.java:141)
at lombok.ast.ecj.EcjTreeConverter$2.visitCompilationUnitDeclaration(EcjTreeConverter.java:441)
at lombok.ast.ecj.EcjTreeVisitor.visitEcjNode(EcjTreeVisitor.java:264)
at lombok.ast.ecj.EcjTreeConverter.visit(EcjTreeConverter.java:295)
at com.android.tools.lint.EcjParser.parseJava(EcjParser.java:407)
at com.android.tools.lint.client.api.JavaVisitor.visitFile(JavaVisitor.java:236)
at com.android.tools.lint.client.api.LintDriver.checkJava(LintDriver.java:1491)
at com.android.tools.lint.client.api.LintDriver.runFileDetectors(LintDriver.java:1026)
at com.android.tools.lint.client.api.LintDriver.checkProject(LintDriver.java:882)
at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.java:433)
at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.java:374)
at com.android.tools.lint.LintCliClient.run(LintCliClient.java:130)
at com.android.build.gradle.internal.LintGradleClient.run(LintGradleClient.java:112)
at com.android.build.gradle.internal.LintGradleClient$run.call(Unknown Source)
at com.android.build.gradle.tasks.Lint.runLint(Lint.groovy:198)
at com.android.build.gradle.tasks.Lint.this$4$runLint(Lint.groovy)
at com.android.build.gradle.tasks.Lint$this$4$runLint$1.callCurrent(Unknown Source)
at com.android.build.gradle.tasks.Lint.lintSingleVariant(Lint.groovy:173)
at com.android.build.gradle.tasks.Lint$lintSingleVariant$0.callCurrent(Unknown Source)
at com.android.build.gradle.tasks.Lint.lint(Lint.groovy:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:579)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:562)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
at org.gradle.tooling.internal.provider.BuildModelAction.run(BuildModelAction.java:43)
at org.gradle.tooling.internal.provider.BuildModelAction.run(BuildModelAction.java:30)
at org.gradle.tooling.internal.provider.ConfiguringBuildAction.run(ConfiguringBuildAction.java:119)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:47)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:35)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:71)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:69)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:69)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:70)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(DaemonHygieneAction.java:39)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:46)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
有什么办法吗?当然,一个简单的工作/解决方法是禁用 lint
检查释放。但我正在寻找解决方案,允许保留 lint
。
以下是应用的模块build.gradle
:
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.neenbedankt.android-apt'
configurations {
apt
}
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 10
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven{
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.jakewharton:butterknife:6.1.0'
compile 'com.google.dagger:dagger:2.0-SNAPSHOT'
compile 'de.greenrobot:eventbus:2.4.0'
retrolambdaConfig 'net.orfjackal.retrolambda:retrolambda:1.8.1'
apt 'com.google.dagger:dagger-compiler:2.0-SNAPSHOT'
provided 'org.glassfish:javax.annotation:10.0-b28'
}
根build.gradle
:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
classpath 'me.tatarka:gradle-retrolambda:2.5.0'
}
}
allprojects {
repositories {
jcenter()
}
}
最佳答案
您可以使用 special lombok version使用不会提示 Java 8 功能的 lint。
buildscript {
repositories {
jcenter()
...
}
dependencies {
classpath 'com.android.tools.build:gradle:<version>'
classpath 'me.tatarka:gradle-retrolambda:<version>'
classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
}
// Exclude the version that the android plugin depends on.
configurations.classpath.exclude group: 'com.android.tools.external.lombok'
}
这样,即使使用最新版本的 Android Gradle 插件,您也可以继续在整个项目上运行 lint。
注意:如果您收到相同的错误,请尝试将上述配置放入最顶部的 build.gradle
文件中。那么它应该可以工作了。
关于android - Retrolambda:使用带有 retrolambda 的 lambda 表达式时,Lint 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29316332/
我正在尝试使用 retrolambda连同 gradle-retrolambda插入。一般来说它工作正常,但是当我编译发布时,lint 阶段失败并出现异常: :playground.dagger:li
我在我的项目中使用了 retrolambda,效果很好。但今天当我使用它时,Android Studio 给了我一个提示: 我以前没有见过这个,我需要如何修改代码才能满足这个提示。 最佳答案 单行表达
我正在开发一个 Android 应用程序,我想出了 RetroLambda 工具,通过它我可以在 Android 应用程序中使用 Lambda 表达式(太棒了!!)。 不幸的是,它不起作用。我正在为应
使用Java 8时,如何在gradle中运行测试任务。我真的不想安装Java When running gradle with java 8, you must set the path to th
我试图在 forEach 循环中访问模型类的 RealmList。 尝试:1 realmList.forEach(obj -> { System.out.println("value"+obj.get
我有以下代码 List trailers = response.body().getResults(); trailers.stream().forEach(trailer -> { View
我是 100% 的 Java 新手,我正在尝试将 Crashlytics 添加到我的 React Native 项目中。我在互联网上能找到的唯一代码 fragment 是 retrolambda 语法
我的 travis.yml 文件: language: android jdk: oraclejdk8 android: components: - build-tools-22.0.1
在我们的项目中,我们使用 gradle + retrolambda + proguard。Retrolambda 增量build设置为 false。 有时构建没有错误但源代码发生了变化不适用于应用程序
大家好,我是 RetroLambda 的新手。现在我将它与 Runnable、OnClickListener 等一起使用。问题是:是否可以将 RetroLambda 与 onTextChangeLis
我将 retrolambda 与 android-retrolambda-lombok 一起使用,但在 :app:lintVital** 任务期间 lint 还是崩溃了。 这两个在我的项目 build
有人在 Google App Engine 项目中使用 Retrolambda 吗?你的 pom.xml 是什么样子的? 为 JDK8 编译并设置 retrolambda 的 maven 插件很简单。
android 在本地成功运行时在 jenkins 上构建失败,下面是构建输出: :app:compileDebugJavaNote: Some input files use or override
因此,有人将 Java 8 的 Lambda 反向移植到 Java 6 和 7。显然它也适用于 Android。该项目名为Retrolambda .我想在 AndroidStudio 上玩这个,但似乎
有没有办法关闭警告 Jack is required to support java 8 language features. 在使用 Retrolambda 时? 我现在不想要 jack 支持,因为
我在 this question 中找到了一些帮助。所以我知道我必须使用 JDK7 才能使单元测试工作。所以我想出了这样的构建脚本: buildscript { repositories
我们使用 gradle 进行构建,但使用 Eclipse 编写。我有 retrolambda 工作正常,eclipse 看到 lambda 语法并且没问题,gradle 构建和运行完美。 唯一的问题是
我正在尝试在我的应用程序中使用 retrolambda,但我遇到了问题 build.gradle 项目 buildscript { repositories { jcenter
我正在尝试获取 retrolambda使用 gradle 构建的 Android。 java 8 的改变导致了一些 android 注释的问题。 我已经尝试了这些帖子中的几乎所有内容:(在阅读所有
我决定创建测试示例: multidex true (1.0.1), rxjava 2.1.0, retrolambda 3.6.0 所以我在 Android 4-6 上看到了错误 安卓 4 06-20
我是一名优秀的程序员,十分优秀!