首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >GoogleService-Info.plist文件未找到,也未以编程方式提供clientId

GoogleService-Info.plist文件未找到,也未以编程方式提供clientId
EN

Stack Overflow用户
提问于 2022-07-25 02:04:04
回答 3查看 2.2K关注 0票数 3

我尝试使用fluttefire命令行工具为我的flutter项目添加firebase。我使用Google身份验证服务从firebase和调用SignIn函数,它会给出以下错误。ios文件夹有GoogleService-Info.plist文件。

代码语言:javascript
运行
复制
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)
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2022-07-25 03:13:37

FlutterFire命令行工具生成Dart文件,因此不需要GoogleService-Info.plist。尽管使用命令行工具插入GoogleService-Info.plist是多余的。但是,在初始化时还必须指定生成的选项:

代码语言:javascript
运行
复制
Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform)

使用DefaultFirebaseOptions是使用Firebase的新方法,而手动插入配置文件则是旧的方法。

编辑:我不明白这个问题与GoogleSignIn插件有关(我没有真正读过堆栈跟踪)。在这种情况下,错误与错误消息中的错误完全相同。您没有指定客户端id:

代码语言:javascript
运行
复制
GoogleSignIn(clientId: DefaultFirebaseOptions.currentPlatform.iosClientId).signIn()

编辑:是的,新版本的flutterfire也会生成相应的文件,如GoogleService-Info.plist,但是您不再需要这些文件了,因为参数clientId存在于GoogleSignIn插件中。

票数 7
EN

Stack Overflow用户

发布于 2022-08-30 22:39:32

有人在github上发布了这个问题。https://github.com/flutter/flutter/issues/96248

他们说。

google_sign_in插件目前不支持只进行省道初始化,同时,您需要在手动安装上退步。

2022年8月31日,我仍然面临着同样的问题

票数 1
EN

Stack Overflow用户

发布于 2022-11-12 17:33:16

将GoogleService-Info.plist文件移动到Runner文件夹为我解决了这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73103392

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档