3
respostas

Erro ao Iniciar Projeto (FAILURE: Build failed with an exception)

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring root project 'android'.

    Could not resolve all artifacts for configuration ':classpath'. Could not resolve com.android.tools.build:gradle:3.5.0. Required by:

       project :

    Could not resolve com.android.tools.build:gradle:3.5.0. Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'. Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Could not resolve com.android.tools.build:gradle:3.5.0. Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'. Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

3 respostas

Marcos, bom dia.

O que vc pode tentar fazer para resolver é apenas rodar o comando "flutter clean" no terminal do seu projeto. E veremos a seguir se consegue rodar o projeto.

Caso não consiga, tente atualizar o SDK do Android e crie novamente.

Veja se consegui te ajudar. Caso positivo, marque a resposta como solucionada. Obrigado e boa sorte!

Olá Murilo tudo bem, fiz o que você falou mas ainda continua o problema, pelo que entendi, é um problema com a minha versão do gradller... mas como resolver?

  • What went wrong: A problem occurred configuring root project 'android'.

    Could not resolve all artifacts for configuration ':classpath'. Could not resolve com.android.tools.build:gradle:3.5.0. Required by:

       project :

    Could not resolve com.android.tools.build:gradle:3.5.0. Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'. Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Could not resolve com.android.tools.build:gradle:3.5.0. Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'. Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom'. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Sendo assim, tenta substituir o seguinte:

Dentro do projeto tem a pasta do android, e nele tem o arquivo de configuração do gradle "build.gradle". Veja se a versão está 3.5 e troque para uma que funcione como a 3.2.1.

Pode limpar novamente se quiser e tentar rodar de novo. Dessa forma estará apontando pra uma versão do gradle existente.

Boa sorte.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software