Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

326
Views
Can I set java 11 by gradle in android project?

I need to set java 11 for build android project anywhere (on build machine for example). I found gradle feature toolchain but I can't find right way to use it in android project. I tried to add in app module build.gradle:

apply plugin: 'com.android.application' 

//first way
java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(11)
    }
}

android {
    //second way
    java {
        toolchain {
            languageVersion = JavaLanguageVersion.of(11)
        }
    }

but I still get error:

Task :my-library-module-name:compileDebugJavaWithJavac FAILED An exception has occurred in the compiler (1.8.0_282). 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. java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable$NameImpl)

where my-library-module-name this is my another android lib gradle module which connected to app module.

It is possible to use gradle toolchain in android project?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!