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

Time:07-25

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)

CodePudding user response:

Fixed by adding GoogleService-Info.plist file manually.

It looks like, adding firebase to flutter the flutterfire command line tool, has this bug, and it cannot add the GoogleService-Info.plist file to ios, in the correct way.

CodePudding user response:

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.

  • Related