导入时运行颤振应用程序时出现以下错误:
import 'package:cloud_firestore/cloud_firestore.dart';
错误:
/C:/Users/Dell5587/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_platform_interface-5.5.0/lib/src/method_channel/method_channel_firestore.dart:112:15: Error: Method not found: 'Error.throwWithStackTrace'.
Error.throwWithStackTrace(
^^^^^^^^^^^^^^^^^^^
/C:/Users/Dell5587/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_platform_interface-5.5.0/lib/src/method_channel/utils/exception.dart:14:11: Error: Method not found: 'Error.throwWithStackTrace'.
Error.throwWithStackTrace(exception, stackTrace);
^^^^^^^^^^^^^^^^^^^
/C:/Users/Dell5587/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_platform_interface-5.5.0/lib/src/method_channel/utils/exception.dart:17:9: Error: Method not found: 'Error.throwWithStackTrace'.
Error.throwWithStackTrace(
^^^^^^^^^^^^^^^^^^^
/C:/Users/Dell5587/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_platform_interface-5.5.0/lib/src/method_channel/utils/exception.dart:12:7: Error: A non-null value must be returned since the return type 'Never' doesn't allow null.
Never convertPlatformException(Object exception, StackTrace stackTrace) {
如能作出一些澄清或提出解决办法,将不胜感激。谢谢你们。
当我删除导入语句时,错误不会出现,应用程序也会运行良好。
发布于 2022-05-21 03:08:03
这个库cloud_firestore包含依赖项cloud_firestore_platform_interface,我认为它解决了这个问题:
flutter clean
../pub.dartlang.org/cloud_firestore_platform_interface-5.5.0
flutter pub add cloud_firestore_platform_interface
flutter run
中的这一行
https://stackoverflow.com/questions/72328866
复制相似问题