【问题标题】:Flutterfire ios configuration issuesFlutterfire ios 配置问题
【发布时间】:2022-07-09 06:36:05
【问题描述】:

由于某种原因,我无法使用 Flutterfire CLI 在 firebase 上配置 ios 应用程序。我以前做过,但这次我遇到了这个错误

FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command.
COMMAND: firebase apps:create ios good_dreams (ios) --bundle-id=com.infatechnologies.good_dreams --json --project=good-dreams-app 
ERROR: Failed to create iOS app for project good-dreams-app. See firebase-debug.log for more info.

我尝试通过 debug.log 文件查看问题所在,我看到了一个带有 401 错误代码的发布请求作为响应。

{
"error": {
"code": 401,
"message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
"status": "UNAUTHENTICATED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "CREDENTIALS_MISSING",
"domain": "googleapis.com",
"metadata": {
"method": "google.firebase.service.v1beta1.IosAppService.ListIosApps",
"service": "firebase.googleapis.com"
}
}
]
}
}

这些缺少的凭据是什么?我如何得到它们?这是整个 firebase-debug.log 文件:

[debug] [2022-02-15T15:41:11.658Z] ----------------------------------------------------------------------
[debug] [2022-02-15T15:41:11.660Z] Command:       /usr/local/bin/firebase /Users/user/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/bin/firebase apps:create ios good_dreams (ios) --bundle-id=com.infatechnologies.good_dreams --json --project=good-dreams-app
[debug] [2022-02-15T15:41:11.660Z] CLI Version:   10.0.1
[debug] [2022-02-15T15:41:11.660Z] Platform:      darwin
[debug] [2022-02-15T15:41:11.660Z] Node Version:  v12.18.1
[debug] [2022-02-15T15:41:11.661Z] Time:          Tue Feb 15 2022 15:41:11 GMT+0000 (Greenwich Mean Time)
[debug] [2022-02-15T15:41:11.661Z] ----------------------------------------------------------------------
[debug] 
[debug] [2022-02-15T15:41:11.708Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2022-02-15T15:41:11.708Z] > authorizing via signed-in user (aduhenry9@gmail.com)
[info] Create your IOS app in project good-dreams-app:
[debug] [2022-02-15T15:41:11.712Z] >>> HTTP REQUEST POST https://firebase.googleapis.com/v1beta1/projects/good-dreams-app/iosApps  
 {"displayName":"good_dreams (ios)","bundleId":"com.infatechnologies.good_dreams"}
[debug] [2022-02-15T15:41:12.192Z] <<< HTTP RESPONSE 400 {"vary":"X-Origin, Referer, Origin,Accept-Encoding","content-type":"application/json; charset=UTF-8","date":"Tue, 15 Feb 2022 15:41:12 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2022-02-15T15:41:12.193Z] <<< HTTP RESPONSE BODY {"error":{"code":400,"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT"}}
[debug] [2022-02-15T15:41:12.194Z] HTTP Error: 400, Request contains an invalid argument.
[debug] [2022-02-15T15:41:12.689Z] FirebaseError: HTTP Error: 400, Request contains an invalid argument.
    at module.exports (/Users/user/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/responseToError.js:38:12)
    at Request._callback (/Users/user/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/api.js:41:35)
    at Request.self.callback (/Users/user/.cache/firebase/tools/lib/node_modules/request/request.js:185:22)
    at Request.emit (events.js:315:20)
    at Request.EventEmitter.emit (domain.js:482:12)
    at Request.<anonymous> (/Users/user/.cache/firebase/tools/lib/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:315:20)
    at Request.EventEmitter.emit (domain.js:482:12)
    at IncomingMessage.<anonymous> (/Users/user/.cache/firebase/tools/lib/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:421:28)
    at IncomingMessage.emit (events.js:327:22)
    at IncomingMessage.EventEmitter.emit (domain.js:482:12)
    at endReadableNT (_stream_readable.js:1221:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
[error] 
[error] Error: Failed to create iOS app for project good-dreams-app. See firebase-debug.log for more info.

【问题讨论】:

  • 如果对您有用,请将该答案标记为已接受。

标签: firebase flutter dart


【解决方案1】:

我认为捆绑 id (ios) 和包名称 (android) 应该相同,但它们不应该。组织可能是相同的,但最后的不应该。这就是问题所在,尽管我能找到的任何指南/教程中都没有说明,甚至在错误消息中也没有说明

【讨论】:

    【解决方案2】:

    这是一个身份验证问题。只需注销 firebase CLI 并重新登录。

    退出:

    firebase logout
    

    再次登录:

    firebase login
    

    【讨论】:

    • 试过了,不行
    • 这不起作用@NanaKwame
    【解决方案3】:

    您始终可以尝试通过 Firebase 控制台手动创建 IOS 应用(我一直都是这样做的)。

    【讨论】:

    • 这看起来工作量很大,配置一次 cli 会更快。无论如何我解决了这个问题,谢谢你的建议
    【解决方案4】:

    配置 iOS:

    flutterfire configure -icom.ios.bubdle
    

    所以添加 -i 然后你的 (ios) 包 id

    来自CLI Commands

    【讨论】:

      【解决方案5】:

      啊哈!我找到了答案。因此,出于某种原因,Apple 不允许在 bundleId 名称中使用下划线(“_”),请将您的 bundleId 更改为不使用下划线,这样就可以了。

      如果这有帮助,请告诉我。

      【讨论】:

        猜你喜欢
        • 2014-04-29
        • 2020-12-13
        • 1970-01-01
        • 2018-07-31
        • 2015-05-21
        • 2017-09-09
        • 2022-06-24
        • 2022-11-04
        • 1970-01-01
        相关资源
        最近更新 更多