Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.XXX
See original GitHub issueHi,
after adding compile 'com.google.guava:guava:21.0'
to my Android project Gradle’s dependencies, I got this build error:
Information:Gradle tasks [:app:assembleBrandAFastBuildDebug] Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Function Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Consumer Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.BiConsumer Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Supplier Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.BiConsumer Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Supplier Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.BinaryOperator Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.BiConsumer Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.BinaryOperator … Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Consumer Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Consumer Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.BiPredicate Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Consumer Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Function Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntFunction Error:Default method void addAll(java.lang.Iterable ranges) not supported in Android API level less than 24 Error:Default method boolean enclosesAll(java.lang.Iterable other) not supported in Android API level less than 24 Error:Default method void removeAll(java.lang.Iterable ranges) not supported in Android API level less than 24 Error:Default method boolean test(java.lang.Object input) not supported in Android API level less than 24 Error:Default method void forEachEntry(java.util.function.ObjIntConsumer action) not supported in Android API level less than 24 Error:Default method void forEach(java.util.function.Consumer action) not supported in Android API level less than 24 Error:Default method java.util.Spliterator spliterator() not supported in Android API level less than 24 Error:Static method void com_google_common_collect_Multiset_lambda$forEach$1(java.util.function.Consumer action, com.google.common.collect.Multiset$Entry entry) not supported in Android API level less than 24 Error:Static method void com_google_common_collect_Multiset_lambda$forEachEntry$0(java.util.function.ObjIntConsumer action, com.google.common.collect.Multiset$Entry entry) not supported in Android API level less than 24 Error:Default method void forEach(java.util.function.BiConsumer action) not supported in Android API level less than 24 Error:Static method void com_google_common_collect_Multimap_lambda$forEach$0(java.util.function.BiConsumer action, java.util.Map$Entry entry) not supported in Android API level less than 24 Error:Execution failed for task ‘:app:transformClassesWithPreJackPackagedLibrariesForBrandAFastBuildDebug’.
com.android.build.api.transform.TransformException: com.android.builder.core.JackToolchain$ToolchainException: Jack compilation exception Information:BUILD FAILED Information:Total time: 1 mins 15.703 secs Information:190 errors Information:0 warnings Information:See complete output in console
I’m already using:
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
...
jackOptions {
enabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Gradle’s project configuration snippet:
classpath 'com.android.tools.build:gradle:2.5.0-alpha-preview-01'
classpath 'me.tatarka:gradle-retrolambda:3.2.5'
In gradle-wrapper.properties
I have:
distributionUrl=https://services.gradle.org/distributions-snapshots/gradle-3.5-20170213202653+0000-all.zip
Could you provide any resolution to this problem?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Java 8 support: compile ‘com.google.guava:guava:22.0-android’
That’s all we’ve got for you, sorry 😦 If it’s any consolation, Guava 21 adds almost nothing except the Java 8 features. We should have Guava 22 (with Android-compatible version) our in the coming quarter.