0

When I try to compile the application it gives this error


    Compiler message:
    /C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.5.0/lib/src/provider/flutter_advanced_networkimage.dart:143:24: Error: The method 'AdvancedNetw
    orkImage.load' has fewer positional arguments than those of overridden method 'ImageProvider.load'.
      ImageStreamCompleter load(AdvancedNetworkImage key) {
                           ^
    /C:/flutter/packages/flutter/lib/src/painting/image_provider.dart:403:24: Context: This is the overridden method ('load').
      ImageStreamCompleter load(T key, DecoderCallback decode);
                           ^
    Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
    build failed.

    FAILURE: Build failed with an exception.

    * Where:
    Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 780

    * What went wrong:
    Execution failed for task ':app:compileFlutterBuildRelease'.
    > Process 'command 'C:\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 58s
    Running Gradle task 'assembleRelease'...
    Running Gradle task 'assembleRelease'... Done                      60,6s
    Gradle task assembleRelease failed with exit code 1

my flutter doctor -v

[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [versão 10.0.17763.1098], locale pt-BR) • Flutter version 1.12.13+hotfix.9 at C:\flutter • Framework revision f139b11009 (6 days ago), 2020-03-30 13:57:30 -0700 • Engine revision af51afceb8 • Dart version 2.7.2

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3) • Android SDK at C:\Users\mathe\AppData\Local\Android\sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.3 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04) • All Android licenses accepted.

[√] Android Studio (version 3.6) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 44.0.2 • Dart plugin version 192.7761 • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[!] Connected device ! No devices available

my pubspec.yaml

name: MatheusApp
description: A new Flutter project.

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.2.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  firebase_analytics: ^5.0.10
  firebase_messaging: ^6.0.13
  firebase_admob: ^0.9.3+1
  admob_flutter: ^0.3.4
  provider: ^4.0.4
  http: ^0.12.0+4
  share: ^0.6.3+6
  shared_preferences: ^0.5.6+3
  flutter_svg: ^0.17.3+1
  flutter_swiper: ^1.1.6
  flutter_webview_plugin: ^0.3.10+2
  flutter_advanced_networkimage: ^0.7.0
  pull_to_refresh: ^1.5.8
  video_player: ^0.10.8+1
  screen: ^0.0.5

dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_launcher_icons: ^0.7.4

flutter_icons:
  android: "ic_launcher" 
  ios: true
  image_path: "assets/icon/icon.png"

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
   - assets/img/
  #  - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages
MMG
  • 3,226
  • 5
  • 16
  • 43
  • my gradle scan: https://gradle.com/s/zw246nwxdun74 – Matheus Abreu Apr 05 '20 at 21:32
  • with respect to your gradle scan link the solution can be `change the jdk version to 14 or change the gradle distribution link to 6+`. refer this [Unsupported class file major version 57](https://stackoverflow.com/questions/58345916/android-launch-issues-unsupported-class-file-major-version-57) – jose praveen Apr 06 '20 at 08:54

0 Answers0