我在试着运行我的扑翼应用程序,它运行得很好。但是,在更新之后,它抛出以下错误。
我已经更新了build.gradle文件(APP级),添加了编译SDK版本(31)。我还更新了存在的依赖项。但是,似乎没有人起到帮助作用。
错误
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
扑扑医生
医生摘要(要查看所有详细信息,请运行Ffltter Doctor-v):[✓]Ffltter(Channel Master,3.4.0-28.0.pre.105,在MacOS 12.6 21G115 Darwin-ARM64上,区域EN-IN)[✓]Android工具链-为Android设备开发(Android SDK版本32.1.0-rc1)
[✓]Xcode-为iOS和MacOS开发(Xcode14.0)
[✓]Chrome-为Web开发
[✓]安卓工作室(2021.2版)
[✓]与代码(版本1.71.2)
[✓]连接的设备(2个可用)
[✓]Http主机可用性
·未发现任何问题!
1条答案
按热度按时间ars1skjm1#
在经历了一些长时间的冲浪之后,以下是使我能够再次成功运行代码的有效方法。
运行以下命令可能会解决该问题。
它很可能来自我的一个依赖项,而且自那以后就没有更新过,以说明对
File
的更改。