问题标签 [jack-compiler]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1372 浏览

android - 错误:来自 jar 文件的 Lambda 需要它们在类路径上的接口才能编译 RxJava2

我正在使用 RxJava2 和 lambda。IDE 是 Android Studio。编译时出现以下错误。

信息:Gradle 任务 [:app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugUnitTestSources, :app:compileDebugAndroidTestSources, :transport:generateDebugSources, :transport:generateDebugAndroidTestSources, :transport:mockableAndroidJar,:transport:prepareDebugUnitTestDependencies,:transport:compileDebugSources,:transport:compileDebugAndroidTestSources,:transport:compileDebugUnitTestSources]

错误:来自 jar 文件的 Lambda 需要编译类路径上的接口,未知接口是 io.socket.emitter.Emitter$Listener

错误:来自 jar 文件的 Lambda 需要编译类路径上的接口,未知接口是 io.reactivex.functions.Predicate

错误:来自 jar 文件的 Lambda 需要编译类路径上的接口,未知接口是 io.reactivex.functions.Consumer

错误:来自 jar 文件的 Lambda 需要编译类路径上的接口,未知接口是 io.socket.emitter.Emitter$Listener

错误:来自 jar 文件的 Lambda 需要编译类路径上的接口,未知接口是 io.socket.emitter.Emitter$Listener

错误:来自 jar 文件的 Lambda 需要编译类路径上的接口,未知接口是 io.reactivex.FlowableOnSubscribe

错误:来自 jar 文件的 Lambda 需要编译类路径上的接口,未知接口是 io.socket.emitter.Emitter$Listener

错误:来自 jar 文件的 Lambda 需要编译类路径上的接口,未知接口是 io.socket.emitter.Emitter$Listener

错误:任务“:app:transformClassesWithPreJackPackagedLibrariesForDebug”的执行失败。

com.android.build.api.transform.TransformException: com.android.builder.core.JackToolchain$ToolchainException: Jack 编译异常

按照我的 build.gradle

以下顺序有效。

  1. 将 minSdkVersion 更改为 25。同步并制作项目。
  2. 再次将 minSdkVersion 更改为 15。同步并制作项目。

但这使得编译非常慢,每次代码更改后我都需要遵循这个顺序。有更好的选择吗?