GoogleService-Info.plist file not found and clientId was not provided programmatically

Viewed 1156

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)
2 Answers

The FlutterFire command line tool generates a Dart file, so you don't need a GoogleService-Info.plist. Inserting a GoogleService-Info.plist although using the Command Line tool is redundant. However, you must also specify the generated options when initializing:

Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform)

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:

GoogleSignIn(clientId: DefaultFirebaseOptions.currentPlatform.iosClientId).signIn()

Someone posted that issues on github. https://github.com/flutter/flutter/issues/96248

And they said.

google_sign_in plugin currently doesn't support dart-only initialization and for mean time, you'll need to fallback on manual installation.

31/Aug/2022, I still face the same problem

Related