任务 ':app:compileFlutterBuildDebug' 执行失败。颤动

时间:2021-03-05 19:53:12

标签: android firebase flutter android-studio dart

这是我运行应用程序时遇到的错误

Running Gradle task 'assembleDebug'...
../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/cloud_firestore-0.9.13+1/lib/src/firestore.dart:11:59: Error: Getter not found: 'instance'.
  Firestore({FirebaseApp app}) : app = app ?? FirebaseApp.instance {
                                                          ^^^^^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/cloud_firestore-0.9.13+1/lib/src/firestore_message_codec.dart:77:33: Error: Method not found: 'FirebaseApp'.
        final FirebaseApp app = FirebaseApp(name: appName);
                                ^^^^^^^^^^^
../firebase_auth/lib/src/firebase_auth.dart:25:67: Error: Getter not found: 'instance'.
  static final FirebaseAuth instance = FirebaseAuth._(FirebaseApp.instance);
                                                                  ^^^^^^^^
FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\Desktop\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 974

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.

我在android studio的Pubspec.yaml文件中的依赖

dependencies:
  flutter:
    sdk: flutter
  cloud_firestore: ^0.9.13
  http: ^0.12.2
  timeago: ^2.0.30
  url_launcher: ^5.7.10
  shared_preferences: ^0.5.12+4
  cupertino_icons: ^0.1.2

dependency_overrides:
  firebase_core: ^0.7.0

对导致此问题的原因有任何想法。

0 个答案:

没有答案