目前,我正在使用带有Firebase的Flutter来添加Facebook和Google登录。现在,当我在所有文档的帮助下添加facebook登录时。我不知道该应用程序有什么问题。它仅在应用程序运行时显示CircularprocessingIndicator。 终端错误
Launching lib/main.dart on POCO F1 in debug mode...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 150.7s (!)
✓ Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk... 9.1s
W/FlutterActivity( 3108): Tried to automatically register plugins with FlutterEngine (io.flutter.embedding.engine.FlutterEngine@7fcef82) but could not find and invoke the GeneratedPluginRegistrant.
I/le.helloflutte( 3108): Background concurrent copying GC freed 88786(4991KB) AllocSpace objects, 52(1876KB) LOS objects, 49% free, 3313KB/6627KB, paused 5.473ms total 97.924ms
W/Gralloc3( 3108): mapper 3.x is not supported
I/Choreographer( 3108): Skipped 37 frames! The application may be doing too much work on its main thread.
Syncing files to device POCO F1... 663ms
Flutter run key commands.
r Hot reload. ???
R Hot restart.
h Repeat this help message.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
An Observatory debugger and profiler on POCO F1 is available at: http://127.0.0.1:43387/ciERcuBRCco=/
E/flutter ( 3108): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method startListeningAuthState on channel plugins.flutter.io/firebase_auth)
E/flutter ( 3108): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7)
E/flutter ( 3108): <asynchronous suspension>
E/flutter ( 3108): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
E/flutter ( 3108): #2 MethodChannelFirebaseAuth.onAuthStateChanged.<anonymous closure> (package:firebase_auth_platform_interface/src/method_channel_firebase_auth.dart:308:25)
E/flutter ( 3108): #3 _runGuarded (dart:async/stream_controller.dart:820:24)
E/flutter ( 3108): #4 _BroadcastStreamController._subscribe (dart:async/broadcast_stream_controller.dart:215:7)
E/flutter ( 3108): #5 _ControllerStream._createSubscription (dart:async/stream_controller.dart:833:19)
E/flutter ( 3108): #6 _StreamImpl.listen (dart:async/stream_impl.dart:475:9)
E/flutter ( 3108): #7 new _ForwardingStreamSubscription (dart:async/stream_pipe.dart:125:10)
E/flutter ( 3108): #8 _ForwardingStream._createSubscription (dart:async/stream_pipe.dart:93:16)
E/flutter ( 3108): #9 _ForwardingStream.listen (dart:async/stream_pipe.dart:88:12)
E/flutter ( 3108): #10 new _ForwardingStreamSubscription (dart:async/stream_pipe.dart:125:10)
E/flutter ( 3108): #11 _ForwardingStream._createSubscription (dart:async/stream_pipe.dart:93:16)
E/flutter ( 3108): #12 _ForwardingStream.listen (dart:async/stream_pipe.dart:88:12)
E/flutter ( 3108): #13 _StreamBuilderBaseState._subscribe (package:flutter/src/widgets/async.dart:137:37)
E/flutter ( 3108): #14 _StreamBuilderBaseState.initState (package:flutter/src/widgets/async.dart:111:5)
E/flutter ( 3108): #15 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4640:58)
E/flutter ( 3108): #16 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4476:5)
E/flutter ( 3108): #17 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
E/flutter ( 3108): #18 Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
E/flutter ( 3108): #19 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4527:16)
E/flutter ( 3108): #20 Element.rebuild (package:flutter/src/widgets/framework.dart:4218:5)
E/flutter ( 3108): #21 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4481:5)
E/flutter ( 3108): #22 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4476:5)
E/flutter ( 3108): #23 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
E/flutter ( 3108): #24 Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
E/flutter ( 3108): #25 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5830:14)
E/flutter ( 3108): #26 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
E/flutter ( 3108): #27 Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
E/flutter ( 3108): #28 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4527:16)
E/flutter ( 3108): #29 Element.rebuild (package:flutter/src/widgets/framework.dart:4218:5)
E/flutter ( 3108): #30 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4481:5)
E/flutter ( 3108): #31 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4476:5)
E/flutter ( 3108): #32 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
E/flutter ( 3108): #33 Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
E/flutter ( 3108): #34 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5830:14)
E/flutter ( 3108): #35 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
E/flutter ( 3108): #36 Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
E/flutter ( 3108): #37 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5830:14)
E/flutter ( 3108): #38 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
E/flutter ( 3108): #39 Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
E/flutter ( 3108): #40 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4527:16)
E/flutter ( 3108): #41 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4675:11)
E/flutter ( 3108): #42 Element.rebuild (package:flutter/src/widgets/framework.dart:4218:5)
E/flutter ( 3108): #43 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4481:5)
E/flutter ( 3108): #44 StatefulElement._firstBuild (package:flutter/
I/le.helloflutte( 3108): ProcessProfilingInfo new_methods=2821 is saved saved_to_disk=1 resolve_classes_delay=8000
使用流生成器检查的登录页面。
import 'package:helloflutter/app/home_page.dart';
import 'package:helloflutter/app/service/firebase_auth.dart';
import 'package:helloflutter/app/sign_in/sign_in_page.dart';
import 'package:flutter/material.dart';
import 'service/firebase_auth.dart';
class LandingPage extends StatelessWidget {
LandingPage({@required this.auth});
final AuthBase auth;
@override
Widget build(BuildContext context) {
return StreamBuilder<User>(
stream: auth.onAuthStateChanged,
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.active) {
User user = snapshot.data;
if (user == null) {
return SignInPage(
auth: auth,
);
}
return HomePage(
auth: auth,
);
} else {
return Scaffold(
body: Center(
child: CircularProgressIndicator(),
),
);
}
},
);
}
}
答案 0 :(得分:0)
您似乎错过了firebase_auth package。确保它在您的发布规范中:firebase_auth: ^0.16.1
(或您要使用的任何版本),然后将其导入到文件中,例如:
import 'package:firebase_auth/firebase_auth.dart';
在您的代码中只有'import service / firebase_auth.dart',我猜这是您在其中定义了一些代码的本地文件。