Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

329
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda