Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

327
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda