【发布时间】:2023-02-11 14:20:58
【问题描述】:
我正在尝试在网络上构建并运行一个 flutter firebase 项目,但是,我一次又一次地收到此错误。我已将我的项目添加到 firebase 并已在 index.html 文件中添加了必要的详细信息,但仍然出现错误。 这是详细的-
[ +7 ms] Done persisting file store
[ +7 ms] Target dart2js failed: Exception: Warning: The 'dart2js' entrypoint script is deprecated, please use
'dart compile
js' instead.
../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_messaging_web-2.4.4/lib/src/internals.dart:2:1:
Error: Error when reading
'../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart':
Error reading
'../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart'
(The system
cannot find the file specified.
)
export 'package:firebase_core/src/internals.dart' hide guardWebExceptions;
^
../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_messaging_web-2.4.4/lib/src/internals.dart:6:8:
Error: Error when reading
'../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart':
Error reading
'../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart'
(The system
cannot find the file specified.
)
import 'package:firebase_core/src/internals.dart' as internals;
^
../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_messaging_web-2.4.4/lib/src/internals.dart:11:20:
Error: Method not found: 'guardWebExceptions'.
return internals.guardWebExceptions(
^^^^^^^^^^^^^^^^^^
Error: Compilation failed.
[ +16 ms] Compiling lib\main.dart for the Web... (completed in 10.7s)
[ +1 ms] "flutter web" took 11,811ms.
[ +6 ms] Exception: Failed to compile application for the Web.
#10 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#11 main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>
[ +159 ms] ensureAnalyticsSent: 153ms
[ +1 ms] Running shutdown hooks
[ ] Shutdown hooks complete
[ +1 ms] exiting with code 1
【问题讨论】:
-
我也有同样的问题。我不记得我做了什么更改,因为之前应用程序编译没有问题,现在它有这个错误。我会继续研究,希望有人能在这里为我们解答。
-
你能解决这个问题吗?
标签: flutter firebase dart google-cloud-firestore flutter-web