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.

Android Gradle Plugin 1.3.0 + Retrolambda breaks compilation of tests

See original GitHub issue

Hello, we’ve updated Android Gradle Plugin to 1.3.0 (didn’t touch anything but this) and now tests with Robolectric does not compile with following error:

:app:compileRetrolambdaRobolectricDebug
:app:preRobolectricDebugUnitTestBuild UP-TO-DATE
:app:prepareRobolectricDebugUnitTestDependencies
:app:processRobolectricDebugUnitTestJavaRes
:app:compileRobolectricDebugUnitTestJavaWithJavac
An exception has occurred in the compiler (1.8.0_45). Please file a bug at 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
:app:compileRobolectricDebugUnitTestJavaWithJavac FAILED

robolectric is flavor with robolectric tests.

Looks like it’s related to #23.

I can file an issue on b.android.com if it’s problem of Android Gradle Plugin.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
rickytribbiacommented, Aug 19, 2015

I found my solution.

As said by @stepango at #61 I change my app.gradle file:

String java8 = getJavaVersion(8)
String java7 = getJavaVersion(7)

retrolambda {
    jdk java8
    oldJdk java7
    javaVersion JavaVersion.VERSION_1_7
//    jvmArgs '-arg1', '-arg2' < if I don't comment this line gradle fails
    defaultMethods false
    incremental true
}

String getJavaVersion(Integer v) {
    def sout = new StringBuffer()
    def proc = "/usr/libexec/java_home -v 1.$v".execute()
    proc.consumeProcessOutput(sout, new StringBuffer())
    proc.waitForOrKill(1000)
    return sout.toString().replace("\n", "").replace("\r", "")
}

Thanks again @ZeroBrain for the support.

0reactions
rickytribbiacommented, Aug 19, 2015

Thanks for your answer.

I have tried to change as you said, but it doesn’t change the error. I have made the suggested edit in my “gradle-wrapper.properties” file and not in “gradle.properties” file as you suggest. In this project i haven’t “gradle.properties” file.

#Sun Mar 01 16:02:38 CET 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip

I check also my GRADLE_USER_HOME env variable and I see:

~/.gradle/wrapper/dists/gradle-2.1-all/488seql5pimt7vjvdsuqhh1ut/gradle-2.1

so I also tried:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip

Looking into ~/.gradle/wrapper/dists/ folder I see gradle_wrapper_dists_subfolders

Read more comments on GitHub >

github_iconTop Results From Across the Web

New Build System - Android Studio Project Site
New Early Preview of Android Gradle Plugin 2.5 ... Disable incremental java compilation when retro-lambda is used. ... 1.3.0 (2015/07/30).
Read more >
Gradle Plugins - AspectJ Gradle - The Android Arsenal
A Gradle plugin which enables AspectJ for Android builds. Supports writing code with AspectJ-lang in .aj files and in java-annotation style.
Read more >
Retrolambda - Jack is required to support java 8 - warning fix
Tested it with android gradle plugin version 2.1.0, buildToolsVersion 24, retrolamba plugin 3.2.5 and 3.3.0-beta4 (latest) and the info message ...
Read more >
A gradle plugin for getting java lambda support in java 6, 7 and ...
Android Gradle Plugin 1.3.0 + Retrolambda breaks compilation of tests. :app:compileRetrolambdaRobolectricDebug :app:preRobolectricDebugUnitTestBuild ...
Read more >
GitHub - luontola/retrolambda: Backport of Java 8's lambda ...
Retrolambda can be run as a Maven plugin, Gradle plugin or command line ... it's the easiest to use Java 8, without Retrolamba,...
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