I tried adding firebase to my flutter project using fluttefire command line tool. I am using Google Authentication service from firebase and calling SignIn
function, it gives the following error. The ios folder has GoogleService-Info.plist
file.
Unhandled Exception: PlatformException(missing-config, GoogleService-Info.plist file not found and clientId was not provided programmatically., null, null)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:167:18)
<asynchronous suspension>
#2 GoogleSignInPlatform.initWithParams (package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart:98:5)
<asynchronous suspension>
#3 GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:267:5)
<asynchronous suspension>
#4 GoogleSignIn.signIn.isCanceled (package:google_sign_in/google_sign_in.dart:402:5)
3
Answers
The FlutterFire command line tool generates a Dart file, so you don’t need a
GoogleService-Info.plist
. Inserting aGoogleService-Info.plist
although using the Command Line tool is redundant. However, you must also specify the generated options when initializing:Using
DefaultFirebaseOptions
is the new way for using Firebase with Flutter and the manual insertion of the configuration files is the old way.EDIT: I didn’t understand that this problem is about the
GoogleSignIn
plugin (I did not really read the stack trace 😅). In this case, the error is exactly the same as in the error message. You have not specified a client id:EDIT:
Yes, the new version of
flutterfire
also generates the corresponding files such asGoogleService-Info.plist
, but you don’t need these files anymore since the parameterclientId
exists in theGoogleSignIn
plugin.Someone posted that issues on github.
https://github.com/flutter/flutter/issues/96248
And they said.
31/Aug/2022, I still face the same problem
Moving GoogleService-Info.plist file to the Runner folder solved it for me.