这是发生异常的地方:
@override
Future<FirebaseUser> getCurrentUser() async {
FirebaseUser user = await _firebaseAuth.currentUser();
return user;
}
确切的错误是:
Exception has occurred.
PlatformException (PlatformException(error, FirebaseApp with name [DEFAULT] doesn't exist. , null))
我的Flutter Doctor输出:
[flutter] flutter doctor -v
[√] Flutter (Channel stable, v1.12.13+hotfix.5, on Microsoft Windows [Version 10.0.17763.914], locale en-US)
• Flutter version 1.12.13+hotfix.5 at D:\src\flutter
• Framework revision 27321ebbad (7 days ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\jcdos\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: D:\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[!] Android Studio (version 3.5)
• Android Studio at D:\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.
exit code 0
这是我的调试控制台:
E/flutter ( 6562): #40 SingleChildRenderObjectElement.mount
package:flutter/…/widgets/framework.dart:5445
E/flutter ( 6562): #41 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3194
E/flutter ( 6562): #42 Element.updateChild
package:flutter/…/widgets/framework.dart:2988
E/flutter ( 6562): #43 ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:4243
E/flutter ( 6562): #44 Element.rebuild
package:flutter/…/widgets/framework.dart:3947
E/flutter ( 6562): #
√ Built build\app\outputs\apk\debug\app-debug.apk.
我已经尝试寻找其他来源来修复该错误,但是没有任何效果。我从应用程序gradle中删除了应用插件:“ com.google.gms.google-services”,因为这导致了我其他问题。并删除了此问题,正如我发现的消息灵通所说的那样,它已经在其他地方被调用了。
如果我保留com.google.gms.google-services,则会收到此错误,这会阻止该应用程序同时在模拟器中运行:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> No matching client found for package name 'com.example.testapp