question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 issue

Hi,

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:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DennyWeinbergcommented, May 24, 2017

Java 8 support: compile ‘com.google.guava:guava:22.0-android’

1reaction
cpovirkcommented, Mar 29, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HELP!!Running jar file error Exception in thread "main" java ...
Hi, There, I worte a simple code, it worked well while I used the command javac and java, but it did not work...
Read more >
Unanswered 'android-jack-and-jill' Questions - Stack Overflow
Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Predicate.
Read more >
4. Functional Interfaces — Java 8 tips 1.0 documentation
In java 8 context, functional interface is an interface having exactly one abstract method called functional method to which the lambda expression's ...
Read more >
Bug List - Bugs
526288, JDT, APT, register.eclipse, VERI, FIXE, AutoValue annotation processor causes java.lang.NoSuchFieldError: MODULE, 2018-03-27.
Read more >
Programming IBM Toolbox for Java
... about which JAR files are required for specific IBM Toolbox for Java functions, see JAR files. ... interface may want to run...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found