invertase / flutterfire_cli

A CLI to help with using FlutterFire in your Flutter applications.
Apache License 2.0
170 stars 48 forks source link

[bug]: Can't create a iOS app: `HTTP Error: 400, Request contains an invalid argument.` #67

Closed nilsreichardt closed 2 years ago

nilsreichardt commented 2 years ago

Is there an existing issue for this?

CLI Version

0.2.1+1

Firebase Tools version

10.7.2

Flutter Doctor Output

[✓] Flutter (Channel stable, 2.10.5, on macOS 12.2.1 21D62 darwin-arm, locale en-DE)
    • Flutter version 2.10.5 at /Users/nils/fvm/versions/2.10.5
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5464c5bac7 (2 weeks ago), 2022-04-18 09:55:37 -0700
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc5)
    • Android SDK at /Users/nils/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0-rc5
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio
    • Android Studio at /Applications/Android Studio Preview.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 57.0.5
    • Dart plugin version 211.7233

[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.3)
    • IntelliJ at /Users/nils/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.3)
    • IntelliJ at /Users/nils/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/212.5457.46/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.66.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.40.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 12.2.1 21D62 darwin-arm
    • Chrome (web)    • chrome • web-javascript • Google Chrome 100.0.4896.127
    ! Error: iPhone von Roland is not connected. Xcode will continue when iPhone von Roland is connected. (code -13)

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

Description

I'm unable to create an app for iOS when running flutterfire configure -a de.kidcoins.faamly_missions.dev -i de.kidcoins.faamly_missions.dev.

My result:

Nils-MBP-13-M1:app nils$ flutterfire configure -a de.kidcoins.faamly_missions.dev -i de.kidcoins.faamly_missions.dev
i Found 9 Firebase projects.
✔ Select a Firebase project to configure your Flutter application with · faamly-missions-dev (faamly-missions-dev) 
✔ Which platforms should your configuration support (use arrow keys & space to select)? · android, ios 
i Firebase android app de.kidcoins.faamly_missions.dev is not registered on Firebase project faamly-missions-dev.
i Registered a new Firebase android app on Firebase project faamly-missions-dev.
i Firebase ios app de.kidcoins.faamly_missions.dev is not registered on Firebase project faamly-missions-dev.
i Registered a new Firebase ios app on Firebase project faamly-missions-dev.
FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command.
COMMAND: firebase apps:create ios faamlymissions (ios) --bundle-id=de.kidcoins.faamly_missions.dev --json --project=faamly-missions-dev 
ERROR: Failed to create iOS app for project faamly-missions-dev. See firebase-debug.log for more info.

Steps to reproduce

  1. Run flutterfire configure -a de.kidcoins.faamly_missions.dev -i de.kidcoins.faamly_missions.dev

Expected behavior

CLI should create the app for iOS.

Screenshots

No response

Additional context and comments

firebaes-debug.log:

[debug] [2022-05-03T11:11:43.695Z] ----------------------------------------------------------------------
[debug] [2022-05-03T11:11:43.696Z] Command:       /usr/local/bin/node /usr/local/bin/firebase apps:create ios faamlymissions (ios) --bundle-id=de.kidcoins.faamly_missions.dev --json --project=faamly-missions-dev
[debug] [2022-05-03T11:11:43.697Z] CLI Version:   10.7.2
[debug] [2022-05-03T11:11:43.697Z] Platform:      darwin
[debug] [2022-05-03T11:11:43.697Z] Node Version:  v16.13.2
[debug] [2022-05-03T11:11:43.699Z] Time:          Tue May 03 2022 13:11:43 GMT+0200 (Central European Summer Time)
[debug] [2022-05-03T11:11:43.699Z] ----------------------------------------------------------------------
[debug] 
[debug] [2022-05-03T11:11:43.712Z] > 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-05-03T11:11:43.713Z] > authorizing via signed-in user (...)
[info] Create your IOS app in project faamly-missions-dev:
[debug] [2022-05-03T11:11:43.719Z] >>> HTTP REQUEST POST https://firebase.googleapis.com/v1beta1/projects/faamly-missions-dev/iosApps  
 {"displayName":"faamlymissions (ios)","bundleId":"de.kidcoins.faamly_missions.dev"}
[debug] [2022-05-03T11:11:43.819Z] <<< HTTP RESPONSE 400 {"vary":"X-Origin, Referer, Origin,Accept-Encoding","content-type":"application/json; charset=UTF-8","date":"Tue, 03 May 2022 11:11:43 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-05-03T11:11:43.821Z] <<< HTTP RESPONSE BODY {"error":{"code":400,"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT"}}
[debug] [2022-05-03T11:11:43.823Z] HTTP Error: 400, Request contains an invalid argument.
[debug] [2022-05-03T11:11:43.872Z] FirebaseError: HTTP Error: 400, Request contains an invalid argument.
    at module.exports (/usr/local/lib/node_modules/firebase-tools/lib/responseToError.js:47:12)
    at Request._callback (/usr/local/lib/node_modules/firebase-tools/lib/api.js:41:35)
    at Request.self.callback (/usr/local/lib/node_modules/firebase-tools/node_modules/request/request.js:185:22)
    at Request.emit (node:events:390:28)
    at Request.emit (node:domain:475:12)
    at Request.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/request/request.js:1154:10)
    at Request.emit (node:events:390:28)
    at Request.emit (node:domain:475:12)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (node:events:509:28)
    at IncomingMessage.emit (node:events:402:35)
    at IncomingMessage.emit (node:domain:475:12)
    at endReadableNT (node:internal/streams/readable:1343:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
[error] 
[error] Error: Failed to create iOS app for project faamly-missions-dev. See firebase-debug.log for more info.
nilsreichardt commented 2 years ago

Ah, I found the issue: Firebase doesn't allow underscore (_) in den bundle id.

image

mianaliusman786 commented 5 months ago

image