2
respostas

Erros com Gradle e Dart warnings

Vou começar tudo do zero, mas começou depois de uma atualiação no Android Studio. Onde se vê o relatório de erros e como pode fazer o debug?

Estava funcionando normal, parou depois de uma atualização, apareceu uma mensagem:

Error:Kotlin: Output directory not specified for Module 'bytebank_android' production

de repente começaram a aparecer erros no Gradle:

BUILD FAILED in 12s Running Gradle task 'assembleDebug'... [!] Gradle threw an error while downloading artifacts from the network. Retrying to download...

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:packageDebug'.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade java.io.FileNotFoundException: C:\Users\Meuusuario\Desktop\projeto\bytebank\build\app\intermediates\signing_config\debug\out\signing-config.json (Acesso negado)

  • 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

BUILD FAILED in 19s [!] Gradle threw an error while downloading artifacts from the network. Retrying to download... Exception: Gradle task assembleDebug failed with exit code 1 the Dart compiler exited unexpectedly.

Warnings em Dart Analysis:

Linha:

floatingActionButton: FloatingActionButton(

onPressed required, o que eu coloco?

The function MyApp isn't defined.

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() => runApp(MaterialApp(
  home: Scaffold(
    body: Column(
      children: <Widget>[
        Card(
          child: ListTile(
            leading: Icon(Icons.monetization_on),
            title: Text('100.0'),
            subtitle: Text('1000'),
          ),
        ),
        Card(
          child: ListTile(
            leading: Icon(Icons.monetization_on),
            title: Text('200.0'),
            subtitle: Text('1000'),
          ),
        ),
      ],
    ),
    appBar: AppBar(
      title: Text('Transferências'),
    ),
    floatingActionButton: FloatingActionButton(
      child: Icon(Icons.add),
    ),
  ),
));
2 respostas

Realmente, recriando o projeto resolveu, mas fica algumas dúvidas, eu não consegui fazer o rebuild do app, já me falaram que isso costuma resolver. Não sei como usar os comandos que aparecem no prompt pra ver o debug do Gradle.

O que fazer quando atualiza e precisar mexer nos arquivos do Gradle?

Olá, tudo bem ?

Vi que sua dúvida foi aberta já tem um tempo :(

Será que conseguiu resolver ? :D

Se sim compartilha conosco como fez!

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