Flutter error on building files in Android Studio

1,633

Try executing this in your terminal :

flutter pub cache repair

If it doesn't work, deleting the flutter folder, along with the cache folder should do the job.

Share:
1,633
dhruv bhati
Author by

dhruv bhati

android developer

Updated on December 20, 2022

Comments

  • dhruv bhati
    dhruv bhati over 1 year

    I have newly installed Flutter on Android Studio. I had a source code of flutter which I want to open using it. I installed the latest flutter plugin and flutter SDK. But when I try to run the app, it shows me the following error:

    Compiler message:
    /C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
      PictureStream();
      ^^^^^^^^^^^^^
    /C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
    abstract class PictureStreamCompleter extends Diagnosticable {
                   ^
    
    Compiler message:
    /C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
      PictureStream();
      ^^^^^^^^^^^^^
    /C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
    abstract class PictureStreamCompleter extends Diagnosticable {
                   ^
    Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
    build failed.
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Script 'C:\Flutter SDK\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 882
    
    * What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.
    > Process 'command 'C:\Flutter SDK\flutter\bin\flutter.bat'' finished with non-zero exit value 1
    
    * 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 23s
    Exception: Gradle task assembleDebug failed with exit code 1
    

    I am completely new to this and have no idea where this error is pointing. I have the latest Flutter SDK version: Flutter 1.17.0 and Dart 2.8.1, it's a stable version. My Android Studio version is 3.6.2

  • dhruv bhati
    dhruv bhati about 4 years
    terminal error : 'flutter' is not recognized as an internal or external command, operable program or batch file.
  • halfer
    halfer about 4 years
    @dhruvbhati: that error can be searched for - it is a very common one on Windows.
  • dhruv bhati
    dhruv bhati about 4 years
    hey , i runned the code in terminal , but getting this error : Reinstalled 181 packages. Failed to reinstall 2 packages: - image 2.1.12 - video_player 0.10.6 pub finished with exit code 69
  • dhruv bhati
    dhruv bhati about 4 years
    is there any way i can reinstall these two only , which didnt installed properly . and if it dosent work then can you tell me the location of the flutter folder and the cache folder to delete
  • dhruv bhati
    dhruv bhati about 4 years
    succesfully done the cache repair , but the error not solved . Please help me as fast as possible . thanks