Obsolete
Status Update
Comments
ja...@google.com <ja...@google.com>
ad...@gmail.com <ad...@gmail.com> #2
can you share your android studio version
be...@google.com <be...@google.com> #3
Is this happening with Studio 3.0?
sy...@google.com <sy...@google.com> #4
Note: This worked for me on Windows 7 Pro 32-bit (with Android Studio 2.3.3). Seems like an issue with adt-branding module (which should contain the "/idea/AndroidStudioApplicationInfo.xml" resource).
ch...@google.com <ch...@google.com> #5
Hi, also happened on Mac Book Pro 15 retina mi-2015
MacOs Sierra 10.12.6
Android Studio 2.3.3
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
MacOs Sierra 10.12.6
Android Studio 2.3.3
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
in...@gmail.com <in...@gmail.com> #6
Thank you for this feedback. Your feedback helps make sure Android development tools are great! Given your issues has been resolved I am closing this issue.
ad...@gmail.com <ad...@gmail.com> #7
My understanding is Jack is the official vehicle for Java 8 support in Android, and Jack is not supported for libraries yet. If you try jackOptions { enabled true } in a library module's gradle file you get an error.
In the short term, I have been able to use Java 8 in libraries with a combination of Retrolamba and modifiying the bootclasspath. See lines 19-23 ofhttps://github.com/adamdye/AndroidLambdaIssue/blob/classpath-fix/build.gradle
Ideally, when this is fixed then I can remove both Retrolambda and the lines in build.gradle.
In the short term, I have been able to use Java 8 in libraries with a combination of Retrolamba and modifiying the bootclasspath. See lines 19-23 of
Ideally, when this is fixed then I can remove both Retrolambda and the lines in build.gradle.
cw...@163.com <cw...@163.com> #8
Dear, i also got the similar error:
ERROR: PrinterCapabilitiesInfo.java:231: Lambda coming from jar file need their
interfaces on the classpath to be compiled, unknown interfaces are java.util.fun
ction.IntConsumer
ERROR: PrinterCapabilitiesInfo.java:235: Lambda coming from jar file need their
interfaces on the classpath to be compiled, unknown interfaces are java.util.fun
ction.IntConsumer
It seems also the Lambada expression error, so i used your advice to append the rt.jar file into the classpth, but it did not work. The error is also there. Do you know how to deal with?
ERROR: PrinterCapabilitiesInfo.java:231: Lambda coming from jar file need their
interfaces on the classpath to be compiled, unknown interfaces are java.util.fun
ction.IntConsumer
ERROR: PrinterCapabilitiesInfo.java:235: Lambda coming from jar file need their
interfaces on the classpath to be compiled, unknown interfaces are java.util.fun
ction.IntConsumer
It seems also the Lambada expression error, so i used your advice to append the rt.jar file into the classpth, but it did not work. The error is also there. Do you know how to deal with?
ad...@gmail.com <ad...@gmail.com> #9
Adding rt.jar to the classpath only gets around the "MethodType not found" error.
You need to use retrolamba to get around the "Lambda coming from jar file need their
interfaces on the classpath to be compiled" error.
You need to use retrolamba to get around the "Lambda coming from jar file need their
interfaces on the classpath to be compiled" error.
ci...@gmail.com <ci...@gmail.com> #10
Hi.
I'm getting a similar error for a library I developed using Java 8.
This is probably the only topic that addresses this issue, haven't found anything on StackOverFlow or somewhere else.
"Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Function"
Below I can see 2 more errors popping out about Jack.
FunFact: I'm not using Lambda expressions.
My setup:
- Android Studio 2.1
- BuildTools 24.0.0
- JackOptions Enabled
- source/target compat 1.8
- Gradle 2.10
- CompiledSDK Version 23
I'm getting a similar error for a library I developed using Java 8.
This is probably the only topic that addresses this issue, haven't found anything on StackOverFlow or somewhere else.
"Error:Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Function"
Below I can see 2 more errors popping out about Jack.
FunFact: I'm not using Lambda expressions.
My setup:
- Android Studio 2.1
- BuildTools 24.0.0
- JackOptions Enabled
- source/target compat 1.8
- Gradle 2.10
- CompiledSDK Version 23
be...@google.com <be...@google.com> #11
Jack supports Java 8 in library modules, but only lambdas can be used if minSdk < 24. Gradle still has some work to support this.
java.util.function is only available on N and above, since the runtime doesn't include it on earlier platforms.
java.util.function is only available on N and above, since the runtime doesn't include it on earlier platforms.
ci...@gmail.com <ci...@gmail.com> #12
Ok, that makes sense.
But, are there any ideas on some sort of backwards compatibility or workarounds?
But, are there any ideas on some sort of backwards compatibility or workarounds?
ci...@gmail.com <ci...@gmail.com> #13
I had a look through my code and I haven't found any explicit import of a function that would Java 8 from the java.util.function. There are a couple of HashMaps, Maps, Lists but those are from earlier releases, and I hardly imagine that would be the problem since they're in java.util but not function.
From what I can understand there are two possibilities:
1. I'm using generic-typed interface to make it easier for the handling Gson de/serialization and somehow that's causing it.
2. In my .jar file I also have some dependencies such as gson and AsyncHttpClient. Either one of them could be it, especially the AsyncHttpClient which requires Java 8, which lead me to require JACK inside my build.gradle of the Android app.
I have the feeling that the second one is the reason.
I'm using Java version 1.8_91, that's on what I developed and compiled my code.
From what I can understand there are two possibilities:
1. I'm using generic-typed interface to make it easier for the handling Gson de/serialization and somehow that's causing it.
2. In my .jar file I also have some dependencies such as gson and AsyncHttpClient. Either one of them could be it, especially the AsyncHttpClient which requires Java 8, which lead me to require JACK inside my build.gradle of the Android app.
I have the feeling that the second one is the reason.
I'm using Java version 1.8_91, that's on what I developed and compiled my code.
fe...@gmail.com <fe...@gmail.com> #14
Also having this problem, here is same sample output
ERROR: AirSwitch.java:103: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: SheetInputText.java:185: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: AirSwitch.java:34: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.animation.ValueAnimator$AnimatorUpdateListener
ERROR: AirSwitch.java:34: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.animation.ValueAnimator$AnimatorUpdateListener
ERROR: PosterCard.java:157: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: ListingCard.java:275: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: TextRow.java:247: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.animation.ValueAnimator$AnimatorUpdateListener
ERROR: BaseSelectionView.java:399: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: ProfilePhotoSheet.java:68: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: SheetProgressBar.java:86: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.animation.ValueAnimator$AnimatorUpdateListener
ERROR: AirSwitch.java:34: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.animation.ValueAnimator$AnimatorUpdateListener
ERROR: ToolbarCoordinator.java:35: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnLayoutChangeListener
ERROR: ToolbarCoordinator.java:35: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnLayoutChangeListener
ERROR: ToolbarCoordinator.java:89: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnLayoutChangeListener
ERROR: StepperRow.java:51: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: StepperRow.java:56: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: AutoSharedElementCallback.java:188: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: AutoSharedElementCallback.java:189: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: InputMarquee.java:92: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: InputMarquee.java:92: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: InputMarquee.java:92: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: AirSwitch.java:103: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: SheetInputText.java:185: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: AirSwitch.java:34: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.animation.ValueAnimator$AnimatorUpdateListener
ERROR: AirSwitch.java:34: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.animation.ValueAnimator$AnimatorUpdateListener
ERROR: PosterCard.java:157: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: ListingCard.java:275: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: TextRow.java:247: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.animation.ValueAnimator$AnimatorUpdateListener
ERROR: BaseSelectionView.java:399: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: ProfilePhotoSheet.java:68: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: SheetProgressBar.java:86: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.animation.ValueAnimator$AnimatorUpdateListener
ERROR: AirSwitch.java:34: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.animation.ValueAnimator$AnimatorUpdateListener
ERROR: ToolbarCoordinator.java:35: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnLayoutChangeListener
ERROR: ToolbarCoordinator.java:35: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnLayoutChangeListener
ERROR: ToolbarCoordinator.java:89: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnLayoutChangeListener
ERROR: StepperRow.java:51: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: StepperRow.java:56: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are android.view.View$OnClickListener
ERROR: AutoSharedElementCallback.java:188: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: AutoSharedElementCallback.java:189: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: InputMarquee.java:92: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: InputMarquee.java:92: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: InputMarquee.java:92: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ci...@gmail.com <ci...@gmail.com> #15
Ok, so the issue was the AsyncHttpLibrary, it's not supported well on Android because of its Java 8 features.
If someone sees this, it's better if you use something else such as AndroidAsyncHttp, a good alternative that works. :)
If someone sees this, it's better if you use something else such as AndroidAsyncHttp, a good alternative that works. :)
ma...@gmail.com <ma...@gmail.com> #16
We still have the problem with following setup:
- Android Studio 2.2 Preview 7
- BuildTools 24.0.1
- JackOptions Enabled
- source/target compat 1.8
- Gradle 2.14
- CompiledSDK Version 24
- Gralde Plugin 2.2.0-alpha6 / alpha7 or 2.1.2
- JDK 8 101 / 92
Is there any roadmap, when library projects can be compiled with Java 8 and lambdas?
When I try to build a library module using following statement:
authenticate(pContext, pIdToken, pClientName, (pResult) -> {});
I get the a compile error:
An exception has occurred in the compiler (1.8.0_101). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com ) after checking the Bug Database (http://bugs.java.com ) for duplicates. Include your program and the following diagnostic in your report. Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.invoke.MethodType not found
When I'll use:
authenticate(pContext, pIdToken, pClientName, null);
it works fine.
- Android Studio 2.2 Preview 7
- BuildTools 24.0.1
- JackOptions Enabled
- source/target compat 1.8
- Gradle 2.14
- CompiledSDK Version 24
- Gralde Plugin 2.2.0-alpha6 / alpha7 or 2.1.2
- JDK 8 101 / 92
Is there any roadmap, when library projects can be compiled with Java 8 and lambdas?
When I try to build a library module using following statement:
authenticate(pContext, pIdToken, pClientName, (pResult) -> {});
I get the a compile error:
An exception has occurred in the compiler (1.8.0_101). Please file a bug against the Java compiler via the Java bug reporting page (
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.invoke.MethodType not found
When I'll use:
authenticate(pContext, pIdToken, pClientName, null);
it works fine.
pi...@gmail.com <pi...@gmail.com> #17
[Comment deleted]
pa...@gmail.com <pa...@gmail.com> #18
Retrolambda as a workaround for libraries comes with performance costs, also slower build cycles. Looking forward to seeing this one fixed.
https://speakerdeck.com/jakewharton/exploring-hidden-java-costs-360-andev-july-2016
cw...@163.com <cw...@163.com> #19
Anyone have any idea how to deal with it? i also had the same error:
:transformClassesWithPreJackRuntimeLibrariesForRelease
ERROR: PrinterCapabilitiesInfo.java:564: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: PrinterCapabilitiesInfo.java:591: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: NotificationActionListLayout.java:266: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.Comparator
ERROR: PrinterCapabilitiesInfo.java:231: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: PrinterCapabilitiesInfo.java:235: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: Settings.java:1645: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: Dialog.java:135: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
com.android.jack.api.v01.CompilationException
at com.android.jack.api.v01.impl.Api01ConfigImpl$Api01CompilationTaskImpl.run(Api01ConfigImpl.java:113)
at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJackApis(AndroidBuilder.java:1821)
at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJack(AndroidBuilder.java:1648)
at com.android.builder.internal.compiler.JackConversionCache.convertLibrary(JackConversionCache.java:99)
at com.android.build.gradle.tasks.JackPreDexTransform.runJack(JackPreDexTransform.java:174)
at com.android.build.gradle.tasks.JackPreDexTransform.transform(JackPreDexTransform.java:119)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:177)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:173)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:172)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
:transformClassesWithPreJackRuntimeLibrariesForRelease
ERROR: PrinterCapabilitiesInfo.java:564: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: PrinterCapabilitiesInfo.java:591: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: NotificationActionListLayout.java:266: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.Comparator
ERROR: PrinterCapabilitiesInfo.java:231: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: PrinterCapabilitiesInfo.java:235: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: Settings.java:1645: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: Dialog.java:135: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
com.android.jack.api.v01.CompilationException
at com.android.jack.api.v01.impl.Api01ConfigImpl$Api01CompilationTaskImpl.run(Api01ConfigImpl.java:113)
at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJackApis(AndroidBuilder.java:1821)
at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJack(AndroidBuilder.java:1648)
at com.android.builder.internal.compiler.JackConversionCache.convertLibrary(JackConversionCache.java:99)
at com.android.build.gradle.tasks.JackPreDexTransform.runJack(JackPreDexTransform.java:174)
at com.android.build.gradle.tasks.JackPreDexTransform.transform(JackPreDexTransform.java:119)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:177)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:173)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:172)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
te...@gmail.com <te...@gmail.com> #20
Still has the same problem
Setup
- Android Studio 2.2 beta3
- compile/min/target SDK version = android-N
- build tools version = 24.0.2
- jack compiler enabled (in app module)
- source/target compatibility = 1.8
- Gradle version = 3.0
- Android Plugin Version = 2.2.0-beta3
- JDK = Oracle Java 8
- OS = Windows 10 64bit
Setup
- Android Studio 2.2 beta3
- compile/min/target SDK version = android-N
- build tools version = 24.0.2
- jack compiler enabled (in app module)
- source/target compatibility = 1.8
- Gradle version = 3.0
- Android Plugin Version = 2.2.0-beta3
- JDK = Oracle Java 8
- OS = Windows 10 64bit
cw...@163.com <cw...@163.com> #22
Has the same issue by jack on java 8 with lambda in library mode:
-android SDK N
-jdk1.8
-build tools 24.0.0
-jack enabled in app module
-android gradle plugin version =2.2.0-beta3
-Gradle version =2.14.1
-OS=ubuntu14.04 LTS
:transformClassesWithPreJackPackagedLibrariesForRelease
:transformClassesWithPreJackRuntimeLibrariesForRelease
ERROR: PrinterCapabilitiesInfo.java:231: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: PrinterCapabilitiesInfo.java:235: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: NotificationActionListLayout.java:266: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.Comparator
ERROR: Settings.java:1645: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: PrinterCapabilitiesInfo.java:564: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: PrinterCapabilitiesInfo.java:591: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: Dialog.java:135: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
com.android.jack.api.v01.CompilationException
at com.android.jack.api.v01.impl.Api01ConfigImpl$Api01CompilationTaskImpl.run(Api01ConfigImpl.java:113)
at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJackApis(AndroidBuilder.java:1852)
at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJack(AndroidBuilder.java:1679)
at com.android.builder.internal.compiler.JackConversionCache.convertLibrary(JackConversionCache.java:99)
at com.android.build.gradle.tasks.JackPreDexTransform.runJack(JackPreDexTransform.java:174)
at com.android.build.gradle.tasks.JackPreDexTransform.transform(JackPreDexTransform.java:119)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:178)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:174)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:173)
-android SDK N
-jdk1.8
-build tools 24.0.0
-jack enabled in app module
-android gradle plugin version =2.2.0-beta3
-Gradle version =2.14.1
-OS=ubuntu14.04 LTS
:transformClassesWithPreJackPackagedLibrariesForRelease
:transformClassesWithPreJackRuntimeLibrariesForRelease
ERROR: PrinterCapabilitiesInfo.java:231: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: PrinterCapabilitiesInfo.java:235: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: NotificationActionListLayout.java:266: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.Comparator
ERROR: Settings.java:1645: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
ERROR: PrinterCapabilitiesInfo.java:564: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: PrinterCapabilitiesInfo.java:591: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.IntConsumer
ERROR: Dialog.java:135: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.lang.Runnable
com.android.jack.api.v01.CompilationException
at com.android.jack.api.v01.impl.Api01ConfigImpl$Api01CompilationTaskImpl.run(Api01ConfigImpl.java:113)
at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJackApis(AndroidBuilder.java:1852)
at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJack(AndroidBuilder.java:1679)
at com.android.builder.internal.compiler.JackConversionCache.convertLibrary(JackConversionCache.java:99)
at com.android.build.gradle.tasks.JackPreDexTransform.runJack(JackPreDexTransform.java:174)
at com.android.build.gradle.tasks.JackPreDexTransform.transform(JackPreDexTransform.java:119)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:178)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:174)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:173)
be...@google.com <be...@google.com> #23
We're working on support for 3rd-party libraries using Java 8, but it's not ready quite yet.
dm...@gmail.com <dm...@gmail.com> #24
hi, about the #15 comment ("Jack supports Java 8 in library modules, but only lambdas can be used if minSdk < 24. Gradle still has some work to support this.")
What is the expected setup? If i enable jack in the library
jackOptions {
enabled true
}
I get the following error:
Error:Library projects cannot enable Jack. Jack is enabled in default config.
I want to upload my modules to a nexus repository, so i guess this would be the only setup that would work for me.
What is the expected setup? If i enable jack in the library
jackOptions {
enabled true
}
I get the following error:
Error:Library projects cannot enable Jack. Jack is enabled in default config.
I want to upload my modules to a nexus repository, so i guess this would be the only setup that would work for me.
mr...@gmail.com <mr...@gmail.com> #25
Same issue here as in #26 comment. We cannot migrate our project to Jack until it is resolved.
se...@gmail.com <se...@gmail.com> #26
I'm having good luck using the Android Maven Plugin project to compile the AAR using Java 8 javac and then importing that artifact into my Android Studio projects. Perhaps that could be a workaround?
As much of a workaround as "Just use a different build system for a bit" can be I mean.
As much of a workaround as "Just use a different build system for a bit" can be I mean.
jp...@google.com <jp...@google.com> #27
A problem during the pre-dex of libraries coming from Jill. Because pre-dex is done without any classpath, Jack is not able to generate the dex here. So, at short term, could be fixed in the Gradle Plugin. At mid term, will be fixed in Jack.
Assigned to gcabillic@ to discuss about the Gradle Plugin pipeline.
Assigned to gcabillic@ to discuss about the Gradle Plugin pipeline.
gc...@google.com <gc...@google.com> #28
A future release of the gradle plugin will not predex classpath libraries and it should solve this issue.
cw...@163.com <cw...@163.com> #29
it is also failed at the latest plugin version 2.2.0 and gradle 3.0. The compiling processing is blocking on transformClassesWithPreJackPackagedLibrariesForDebug task and finally faied.
yu...@gmail.com <yu...@gmail.com> #30
What future release of gradle plugin will solve the issue?
2.2.2 still doesn't work.
This issue is critical to my project.
2.2.2 still doesn't work.
This issue is critical to my project.
lo...@gmail.com <lo...@gmail.com> #31
@ #35
Depending on your library modules sizes, converting code with lambdas to kotlin (via IDE option), which supports lambdas too, but without java 8 might be a good idea. The kotlin learning curve is very easy for java developers, and it's a high java interop, so should not hurt your project
Depending on your library modules sizes, converting code with lambdas to kotlin (via IDE option), which supports lambdas too, but without java 8 might be a good idea. The kotlin learning curve is very easy for java developers, and it's a high java interop, so should not hurt your project
ug...@gmail.com <ug...@gmail.com> #32
I found the same issue by using method reference in library module, and it does work in application module.
I put the project in attachment.
Hope it helps
I put the project in attachment.
Hope it helps
ma...@gmail.com <ma...@gmail.com> #33
jars using java8 features still do not work. This is huge blocker since some (important) public java projects switched to java8 - and that leaves even newest versions of android (0.3% share atm - wow) out of java ecosystem. Is there any ETA for next version of plugin? Will this issue be addressed at all?
lm...@gmail.com <lm...@gmail.com> #34
I'm also having the same issue. I am trying to share JARs with my Java developer co-workers. We are building an identical Android and Java FX application, and we want to share code. Since they are using Java 8, they would like to build external JARs that I can add to my Android project. We were hoping with the Jack toolchain this could be accomplished, but I am getting the same errors as above.
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.Predicate
I am also using gradle 2.2.2, and this issue is also critical to my project.
Android Studio 2.2.2
Build #AI-145.3360264, built on October 18, 2016
JRE: 1.8.0_76-release-b03 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
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.Predicate
I am also using gradle 2.2.2, and this issue is also critical to my project.
Android Studio 2.2.2
Build #AI-145.3360264, built on October 18, 2016
JRE: 1.8.0_76-release-b03 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
ja...@gmail.com <ja...@gmail.com> #35
Using Gradle 3,2 problem remains.
rc...@gmail.com <rc...@gmail.com> #36
Same problem here. Any plans to fix this in the near future?
rd...@gmail.com <rd...@gmail.com> #37
Experiencing the same problem, newest alpha
za...@ukr.net <za...@ukr.net> #38
As a workaround we are adding libraries sources into main android project, managing them using git external.
Developers say:
"A future release of the gradle plugin will not predex classpath libraries and it should solve this issue".
At the same time manual says "Currently, Jack does not reuse the library pre-dex if shrinking/obfuscation/repackaging is used in the compilation."
It may make you think that enabling shrinking may fix the Java 8 lib issue. However it didn't work for me...
Developers say:
"A future release of the gradle plugin will not predex classpath libraries and it should solve this issue".
At the same time manual says "Currently, Jack does not reuse the library pre-dex if shrinking/obfuscation/repackaging is used in the compilation."
It may make you think that enabling shrinking may fix the Java 8 lib issue. However it didn't work for me...
lm...@gmail.com <lm...@gmail.com> #39
Just tried android gradle plugin 2.2.3 and it's still an issue
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:2.2.3'
no...@gmail.com <no...@gmail.com> #40
The year is 2017 and problem is still going -_-
de...@gmail.com <de...@gmail.com> #41
Tossing my hat into this ring as well... I've followed a number of suggested workaround without any luck. Any suggestions or a fix would be GREATLY appreciated.
zh...@gmail.com <zh...@gmail.com> #42
Have you guys tried using Retrolambda instead of Jack in the meantime?
lm...@gmail.com <lm...@gmail.com> #43
I have an Android project that is using Retrolamba version 3.4.0, where I'm using lambda expressions no problem in my own native Android code, but when I add the external JAR to the project, build and deploy, I get this error:
Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
Is this error saying that the submodule in the pure Java IntelliJ project where I built the external JAR needs to be using those compatibility versions in the gradle build file?
Here's my Android gradle file:
plugins {
id "me.tatarka.retrolambda" version "3.4.0"
}
apply plugin: 'com.android.application'
android {
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
mavenCentral() // jcenter() works as well because it pulls from Maven Central
flatDir {
dirs 'libs'
}
}
...
Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
Is this error saying that the submodule in the pure Java IntelliJ project where I built the external JAR needs to be using those compatibility versions in the gradle build file?
Here's my Android gradle file:
plugins {
id "me.tatarka.retrolambda" version "3.4.0"
}
apply plugin: 'com.android.application'
android {
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
mavenCentral() // jcenter() works as well because it pulls from Maven Central
flatDir {
dirs 'libs'
}
}
...
ga...@google.com <ga...@google.com> #44
Hi everyone, we are aware this issue still exists. Unfortunately, I cannot give any time estimates, but this is pretty high up in our list of priorities. Once I have more details, I will update this bug.
he...@gmail.com <he...@gmail.com> #45
I'm using the gradle-experimental plugin, and I am also still facing this issue. I have not been able to work around it neither with retrolambda and/or the rt.jar fix.
Could you give any info on when the experimental plugin could have this fix? Will it be fixed there first or only after the official release? Since I need a library project with both NDK support and Java8 Lambdas I'm currently completely blocked.
Could you give any info on when the experimental plugin could have this fix? Will it be fixed there first or only after the official release? Since I need a library project with both NDK support and Java8 Lambdas I'm currently completely blocked.
cn...@gmail.com <cn...@gmail.com> #46
i found it was solved in new gradle beta version.
Is there any plan for solving in jack? We need compile apps by makefile.
Thanks.
Is there any plan for solving in jack? We need compile apps by makefile.
Thanks.
he...@gmail.com <he...@gmail.com> #47
#51, which version did you find this solved in?
Thanks.
Thanks.
cn...@gmail.com <cn...@gmail.com> #48
gradle plugin 2.3.0 beta
he...@gmail.com <he...@gmail.com> #49
Thanks.I just realized the 2.2.0 release mentions native support,which I also need. Maybe using 2.3.0 beta solves both my needs!
It would be cool if Google could clarify the release schedule for the gradle plugin vs the experimental dito...
It would be cool if Google could clarify the release schedule for the gradle plugin vs the experimental dito...
lm...@gmail.com <lm...@gmail.com> #50
Updated to gradle plugin 2.3.0-beta4. Using the Jack compiler, I was able to add an external JAR compiled with Java 8 to my project and deploy my app.
classpath 'com.android.tools.build:gradle:2.3.0-beta4'
android {
...
defaultConfig {
...
jackOptions {
enabled true
}
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
However, I was unable to add the external JAR and deploy my app using Retrolambda (which of course appears to be not needed anymore)
Here's the latest version of gradle plugin if anyone is looking for it:
https://jcenter.bintray.com/com/android/tools/build/gradle/
classpath 'com.android.tools.build:gradle:2.3.0-beta4'
android {
...
defaultConfig {
...
jackOptions {
enabled true
}
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
However, I was unable to add the external JAR and deploy my app using Retrolambda (which of course appears to be not needed anymore)
Here's the latest version of gradle plugin if anyone is looking for it:
he...@gmail.com <he...@gmail.com> #51
#55 That's fine, but that's not really what this issue is about, is it? The issue here is creating an *android library* with support for Java8 lambdas. If you were merely creating an *application*, this should have been working since Jack was first introduced?
bk...@gmail.com <bk...@gmail.com> #52
Hmm, does this problem have anything to do with the fact that lambda is in
fact not correctly compiled in certain cases? Issue 36949180
<https://code.google.com/p/android/issues/detail?id=220207 >:
fact not correctly compiled in certain cases?
<
fu...@astri.org <fu...@astri.org> #53
Currently solved by
classpath 'com.android.tools.build:gradle:2.3.0-rc1'
Please don't break again in the final release.
classpath 'com.android.tools.build:gradle:2.3.0-rc1'
Please don't break again in the final release.
he...@gmail.com <he...@gmail.com> #54
#58: I tried updating to gradle:2.3.0-rc1, but still no luck.
I am also using gradle 3.3 with Android Studio 2.2.2. I can now enable JavaVersion.VERSION_1_8. When I try to enable Jack I get an error that Jack is on by default for libraries, which seems fine so I skip that.
However, as soon as I convert any anonymous interface implementation to a lambda, the IDE does not indicate any syntax error, but it does fail during build.
Execution failed for task ':lib:compileReleaseJavaWithJavac'.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.invoke.MethodType not found.
BTW, since I also need to create a maven artifact for my library, I tried the install task using android-maven-gradle-plugin:1.5 and it also fails.
I am about to give up on ever being able to use lambdas in my libraries...
I am also using gradle 3.3 with Android Studio 2.2.2. I can now enable JavaVersion.VERSION_1_8. When I try to enable Jack I get an error that Jack is on by default for libraries, which seems fine so I skip that.
However, as soon as I convert any anonymous interface implementation to a lambda, the IDE does not indicate any syntax error, but it does fail during build.
Execution failed for task ':lib:compileReleaseJavaWithJavac'.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.invoke.MethodType not found.
BTW, since I also need to create a maven artifact for my library, I tried the install task using android-maven-gradle-plugin:1.5 and it also fails.
I am about to give up on ever being able to use lambdas in my libraries...
pi...@gmail.com <pi...@gmail.com> #55
My setup
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.piotr.netgururecruit"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
jackOptions {
enabled true
}
...
dependencies {
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
It worked fine until I added `guava` library to my app.
See:https://github.com/google/guava/issues/2759
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.piotr.netgururecruit"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
jackOptions {
enabled true
}
...
dependencies {
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=
It worked fine until I added `guava` library to my app.
See:
ga...@google.com <ga...@google.com> #56
Thank you for your feedback. We've decided to add support for Java 8 language features directly into the current javac and dx set of tools, and deprecate the Jack toolchain. For more info please see https://android-developers.googleblog.com/2017/03/future-of-java-8-language-feature.html .
lm...@gmail.com <lm...@gmail.com> #57
We'll share more details when we release the new support in Android Studio. -> Any idea when this well be? Seems like you should mark this ticket as Obsolete after you've released the new support in Android Studio.
[Deleted User] <[Deleted User]> #58
This issue does appear to be resolved in Android Studio 2.4. Verified in preview 7.
ka...@live.com <ka...@live.com> #59
Yes, but this is Jack issue and jack is deprecated now. Should be fine in preview 7 with java 1_8 compatibility and jack off. At least it works in lib I'm working on.
Description
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.invoke.MethodType not found.
A sample project to demonstrate the problem can be found here:
Setup
- Android Studio 2.2 preview 1
- compile/min/target SDK version = android-N
- build tools version = 24.0.0.rc4
- jack compiler enabled (in app module)
- source/target compatibility = 1.8
- Gradle version = 2.10
- Android Plugin Version = 2.2.0-alpha1
- JDK = Oracle Java 8
- OS = ubuntu 16.04 LTS