android – Flutter throws an error on application run

0
98


I was trying to run my flutter app that worked just fine. But, after an update, it throws the following error.

I’ve updated the Build.gradle file(app level), added a compile sdk version(31).
I’ve also updated the dependencies there are. But, none seem to help.

Error

Launching lib/main.dart on Android SDK built for arm64 in debug mode...
lib/main.dart:1
: Error: The method 'File.create' has fewer named arguments than those of overridden method 'File.create'.
../…/interface/file.dart:15
  Future<File> create({bool recursive = false});
               ^
org-dartlang-sdk:///third_party/dart/sdk/lib/io/file.dart:232:16: Context: This is the overridden method ('create').
  Future<File> create({bool recursive = false, bool exclusive = false});
               ^
: Error: The method 'File.create' doesn't have the named parameter 'exclusive' of overridden method 'File.create'.
../…/interface/file.dart:15
  Future<File> create({bool recursive = false});
               ^
org-dartlang-sdk:///third_party/dart/sdk/lib/io/file.dart:232:16: Context: This is the overridden method ('create').
  Future<File> create({bool recursive = false, bool exclusive = false});
               ^
: Error: The method 'ForwardingFile.createSync' has fewer named arguments than those of overridden method 'File.createSync'.
../…/forwarding/forwarding_file.dart:22

Pubspec.yaml

name: zepper
description: The .

publish_to: 'none' # Remove this line if you wanna publish to pub.dev

version: 1.0.0+1

environment:
  sdk: ">=2.17.0-261.0.dev <3.0.0"

dependencies:
# Firebase dependencies
  cloud_firestore: ^3.4.9
  firebase_auth: ^3.10.0
  firebase_core: ^1.23.0
  firebase_messaging: ^13.0.3
  firebase_storage: ^10.3.9

# Visual dependecies
  image_picker: ^0.8.5+3
  qr_flutter: ^4.0.0
  google_fonts: ^3.0.1

# service dependencies
  http: ^0.13.5
  url_launcher: ^6.1.5
  dart_jsonwebtoken: ^2.4.2
  flutter_secure_storage: ^6.0.0

# state management dependencies
  flutter_riverpod: ^1.0.4

# Standard dependencies
  cupertino_icons: ^1.0.2
  flutter:
    sdk: flutter
  
  

dev_dependencies:
  flutter_lints: ^2.0.0
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

  assets:
    - assets/illustrations/
  #   - images/a_dot_ham.jpeg
  # 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

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 3.4.0-28.0.pre.105, on macOS 12.6 21G115 darwin-arm64, locale en-IN)
[✓] Android toolchain – develop for Android devices (Android SDK version 32.1.0-rc1)

[✓] Xcode – develop for iOS and macOS (Xcode 14.0)

[✓] Chrome – develop for the web

[✓] Android Studio (version 2021.2)

[✓] VS Code (version 1.71.2)

[✓] Connected device (2 available)

[✓] HTTP Host Availability

• No issues found!