Android studio# jdk8# class file for Java.lang.invoke.MethodType not found

Source: Internet
Author: User
Tags maven central

Https://github.com/evant/gradle-retrolambda/issues/23

class file for Java.lang.invoke.MethodType not found #23 ClosedDziobas opened thisissue on June 23, 2014 10 CommentsNotifications

You ' re not receiving notifications from the this thread.

5 participants DziobasCommented on June 23, 2014

I tried to setup new sample project and it can ' t compile.

  An exception have occurred in the compiler (1.8.0_05). Please file a bug in the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the bug Parade 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 
* Exception Is:org.gradle.api.tasks.TaskExecutionException:Execution failed for task ': App:compiledebugjava '. At Org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions ( executeactionstaskexecuter.java:69) at    Org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute (executeactionstaskexecuter.java:46) At Org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute ( POSTEXECUTIONANALYSISTASKEXECUTER.JAVA:35) ... caused By:org.gradle.api.internal.tasks.compile.CompilationFailedException:Compilation failed;    See the compiler error output for details. At Org.gradle.api.internal.tasks.compile.jdk6.Jdk6JavaCompiler.execute (jdk6javacompiler.java:47) at Org.gradle.api.internal.tasks.compile.jdk6.Jdk6JavaCompiler.execute (jdk6javacompiler.java:38) at Org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors ( normalizingjavacompiler.java:96) at Org.gradle.api.internal.tasks.compile.NormaLizingjavacompiler.execute (normalizingjavacompiler.java:49) at Org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute (normalizingjavacompiler.java:35) at Org.gradle.api.internal.tasks.compile.DelegatingJavaCompiler.execute (delegatingjavacompiler.java:29) at Org.gradle.api.internal.tasks.compile.DelegatingJavaCompiler.execute (DELEGATINGJAVACOMPILER.JAVA:20) at Org.gradle.api.internal.tasks.compile.IncrementalJavaCompilerSupport.execute ( INCREMENTALJAVACOMPILERSUPPORT.JAVA:33) at Org.gradle.api.internal.tasks.compile.IncrementalJavaCompilerSupport.execute ( incrementaljavacompilersupport.java:24) at Org.gradle.api.tasks.compile.Compile.compile (compile.java:67) at Org.gradle.internal.reflect.JavaMethod.invoke (javamethod.java:63) at Org.gradle.api.internal.project.taskfactory.annotationprocessingtaskfactory$standardtaskaction.doexecute ( annotationprocessingtaskfactory.java:219) at Org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactOry$standardtaskaction.execute (annotationprocessingtaskfactory.java:212) at Org.gradle.api.internal.project.taskfactory.annotationprocessingtaskfactory$standardtaskaction.execute ( annotationprocessingtaskfactory.java:201) at Org.gradle.api.internal.abstracttask$taskactionwrapper.execute (    abstracttask.java:533) at Org.gradle.api.internal.abstracttask$taskactionwrapper.execute (AbstractTask.java:516) At Org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction ( EXECUTEACTIONSTASKEXECUTER.JAVA:80) at Org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions ( executeactionstaskexecuter.java:61) ... More

Setup is similar as in the doc except:

retrolambda {    jdk System.getenv("JAVA8_HOME")    oldJdk System.getenv("JAVA7_HOME")    javaVersion JavaVersion.VERSION_1_7}

Environment variables is set to:
/library/java/javavirtualmachines/jdk1.8.0_05.jdk/contents/home
/library/java/javavirtualmachines/jdk1.7.0_51.jdk/contents/home
respectively.

Owner evantCommented on June 23, 2014

I ' m having trouble repoducing your issue. I had a few questions that could narrow it down.

What version of Java is your using to run Gradle? ( java -version or echo $JAVA_HOME )
What version of OSX is you running?
Could you post your whole so build.gradle I can see if there is any other difference I can check?

DziobasCommented on June 23, 2014
java -versionjava version "1.8.0_05"Java(TM) SE Runtime Environment (build 1.8.0_05-b13)Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

Build.gradle

repositories {mavencentral ()}buildscript {repositories {mavencentral ()} dependencies {class Path ' com.android.tools.build:gradle:0.11.+ ' classpath ' me.tatarka:gradle-retrolambda:1.3.2 '}}apply plugin: ' Re        Trolambda ' Apply plugin: ' Android ' Android {compilesdkversion buildtoolsversion ' 19.1.0 ' defaultconfig {        ApplicationID "Com.testproject.lambdasandbox" Minsdkversion targetsdkversion versioncode 1 Versionname "1.0"} buildtypes {release {Runproguard false proguardfiles Getdefau Ltproguardfile (' Proguard-android.txt '), ' Proguard-rules.pro '}} compileoptions {sourcecompatibility Javaversion.version_1_8 targetcompatibility javaversion.version_1_8}}retrolambda {jdk System.getenv ("JAVA8_        HOME ") oldjdk system.getenv (" Java7_home ") javaversion javaversion.version_1_7}dependencies {repositories {   Mavencentral ()} Compile Filetree (dir: ' Libs ', include: [' *.jar ']) Compile ' com.android.support:appcompat-v7:19.+ '//Latest one on Maven Central//Retrolambdaconfig ' net.orfjackal.retrolambda:retrolambda:1.+ '}
./gradlew --version------------------------------------------------------------Gradle 1.10------------------------------------------------------------Build time:   2013-12-17 09:28:15 UTCBuild number: noneRevision:     36ced393628875ff15575fa03d16c1349ffe8bb6Groovy:       1.8.6Ant:          Apache Ant(TM) version 1.9.2 compiled on July 8 2013Ivy:          2.2.0JVM:          1.8.0_05 (Oracle Corporation 25.5-b02)OS:           Mac OS X 10.9.3 x86_64
Owner evantCommented on June 24, 2014 solution here

Try Swapping and apply plugin: ‘retrolambda‘apply plugin: "android"

DziobasCommented on June 24, 2014

That is it, thank you!

Dziobas closed This on June,

Android studio# jdk8# class file for Java.lang.invoke.MethodType not found

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.