gpt4 book ai didi

android - 如何解决此问题错误 : Couldn't resolve the package?

转载 作者:行者123 更新时间:2023-12-05 02:41:39 27 4
gpt4 key购买 nike

我遇到了这个问题。我怎么解决这个问题。请帮助我。

Error: Couldn't resolve the package 'intl' in 'package:intl/intl.dart'.
lib/screens/chat.dart:4:8: Error: Not found: 'package:intl/intl.dart'
import 'package:intl/intl.dart';
^
lib/screens/chat.dart:98:13: Error: 'DateFormat' isn't a type.
final DateFormat date_formatter = DateFormat('yyyy-MM-dd');
^^^^^^^^^^
lib/screens/chat.dart:99:13: Error: 'DateFormat' isn't a type.
final DateFormat time_formatter = DateFormat('hh:ss');
^^^^^^^^^^
lib/screens/chat.dart:98:41: Error: The method 'DateFormat' isn't defined for the class '_
ChatState'.
- '_ChatState' is from 'package:ecommerce_flutter/screens/chat.dart' ('lib/screens
/chat.dart').
Try correcting the name to the name of an existing method, or defining a method named 'Dat
eFormat'.
final DateFormat date_formatter = DateFormat('yyyy-MM-dd');
^^^^^^^^^^
lib/screens/chat.dart:99:41: Error: The method 'DateFormat' isn't defined for the class '_
ChatState'.
- '_ChatState' is from 'package:ecommerce_flutter/screens/chat.dart' ('lib/screens
/chat.dart').
Try correcting the name to the name of an existing method, or defining a method named 'Dat
eFormat'.
final DateFormat time_formatter = DateFormat('hh:ss');
^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/chewie-0.9.10/lib/src/chewie_player.dar
t:83:7: Error: No named parameter with the name 'resizeToAvoidBottomPadding'.
resizeToAvoidBottomPadding: false,
^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/material/scaffold.dart:1466:9: Context: Found thi
s candidate, but the arguments don't match.
const Scaffold({
^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/chewie-0.9.10/lib/src/chewie_player.dar
t:276:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'Bu
ildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/p
ackages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inh
eritFromWidgetOfExactType'.
context.inheritFromWidgetOfExactType(_ChewieControllerProvider)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/chewie_audio-1.0.0+1/lib/src/chewie_pla
yer.dart:101:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the cl
ass 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/p
ackages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inh
eritFromWidgetOfExactType'.
context.inheritFromWidgetOfExactType(_ChewieAudioControllerProvider)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.18.1/lib/src/picture_prov
ider.dart:50:59: Error: No named parameter with the name 'nullOk'.
context != null ? Localizations.localeOf(context, nullOk: true) : null,
^^^^^^
/C:/src/flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found
this candidate, but the arguments don't match.
static Locale localeOf(BuildContext context) {
^^^^^^^^
Unhandled exception:
FileSystemE
xception(uri=org-dartlang-untranslatable-uri:package%3Aintl%2Fintl.dart; message=StandardFileSystem only supports file:* and data:* URIs)
#0 StandardFileSystem.entityForUri (package:front_end/src/api_proto
type/standard_file_system.dart:36:7)
#1 asFileUri (package:vm/ker
nel_front_end.dart:599:37)
#2 writeDepfile (package:vm/kernel_front_end.dart:738:21)
<asynchrono
us suspension>
#3 FrontendCompiler.compile (package:frontend_server/frontend_server.
dart:562:9)
<asynchronous suspension>
#4 starter (package:flutter_fron
tend_server/server.dart:180:12)
<asynchronous suspension>
#5 main (file:///C:/b
/s/w/ir/cache/builder/src/flutter/flutter_frontend_server/bin/starter.dart:13:2
4)
<asynchronous suspension>

FAILURE: Build failed with an exception.

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

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'C:\src\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.

C:\src\flutter\bin\flutter.bat doctor --verbose
[√] Flutter (Channel stable, 2.2.2, on Microsoft Windows [Version 10.0.19042.1052], locale en-US)
• Flutter version 2.2.2 at C:\src\flutter
• Framework revision d79295af24 (7 days ago), 2021-06-11 08:56:01 -0700
• Engine revision 91c9fc8fe0
• Dart version 2.13.3

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:\Users\mehed\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)

[√] VS Code (version 1.57.0)
• VS Code at C:\Users\mehed\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.23.0

[√] Connected device (2 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.101
• Edge (web) • edge • web-javascript • Microsoft Edge 91.0.864.48

• No issues found!
Process finished with exit code 0

最佳答案

1 个月后,我遇到了 Equatable 的确切问题。

有时你的缓存很脏,所以你需要清理:

我们会告诉您的每个解决方案:

flutter clean

然后

flutter pub get

希望对你有用。对我来说它没有:(。

关于android - 如何解决此问题错误 : Couldn't resolve the package?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68032866/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com