flutterfire_cli icon indicating copy to clipboard operation
flutterfire_cli copied to clipboard

[bug]: flutterfire configure does not generate GoogleService-Info.plist

Open maRci002 opened this issue 1 year ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues.

CLI Version

1.0.0

Firebase Tools version

13.15.4

Flutter Doctor Output

[√] Flutter (Channel stable, 3.24.1, on Microsoft Windows [Version 10.0.19045.4780], locale hu-HU) • Flutter version 3.24.1 on channel stable at C:\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 5874a72aa4 (7 days ago), 2024-08-20 16:46:00 -0500 • Engine revision c9b9d5780d • Dart version 3.5.1 • DevTools version 2.37.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at C:\Users\maRci002\AppData\Local\Android\Sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = C:\Users\maRci002\AppData\Local\Android\Sdk • ANDROID_SDK_ROOT = C:\Users\maRci002\AppData\Local\Android\Sdk • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314) • All Android licenses accepted.

[√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.0) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.7.34003.232 • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2024.1) • Android Studio at C:\Program Files\Android\Android Studio • 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 17.0.11+0--11852314)

[√] VS Code (version 1.92.2) • VS Code at C:\Users\maRci002\AppData\Local\Programs\Microsoft VS Code • Flutter extension can be installed from: https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.4780] • Chrome (web) • chrome • web-javascript • Google Chrome 127.0.6533.122 • Edge (web) • edge • web-javascript • Microsoft Edge 128.0.2739.42

[√] Network resources • All expected network resources are available.

• No issues found!

Description

GoogleService-Info.plist file isn't generated

Steps to reproduce

Running this command neither generates the GoogleService-Info.plist file nor throws an error.

flutterfire configure ^
--project xxx-app-a128a128 ^
--out lib/app/firebase_options/prod/firebase_options.dart ^
-i com.example.xxxApp ^
--ios-out ios/firebase_config/prod ^
--platforms ios

Expected behavior

GoogleService-Info.plist file is generated

Screenshots

No response

Additional context and comments

No response

maRci002 avatar Aug 27 '24 11:08 maRci002

@maRci002 - Have you tried the latest dev version?

dart pub global activate flutterfire_cli 1.0.1-dev.4

russellwheatley avatar Aug 28 '24 09:08 russellwheatley

Not OP but same issue on Windows and MacOS.

I tried with the version 1.0.0 and the latest dev version with the same result for both versions.

What I tested :

  • Windows : flutterfire configure -p {myproject} --out lib/flavor/dev/firebase_options.dart -i {mybundleId} --platforms ios --ios-out="ios/Runner/Config/GoogleService-info.plist". No file generated. The output contains no information about the GoogleService-info.plist.

  • Windows : flutterfire configure -p {myproject} --out lib/flavor/dev/firebase_options.dart -i {mybundleId} --platforms="ios" --ios-out="d:\{projectfolder}\ios\Runner\Config\GoogleService-info.plist" No file generated. The output contains no information about the GoogleService-info.plist.

  • MacOS : flutterfire configure -p {myproject} --out lib/flavor/dev/firebase_options.dart -i {mybundleid} --platforms ios --ios-out="ios/Runner/Config/GoogleService-info.plist" -y --ios-build-config=Debug No file generated. But the cli asks ? Enter a path for your ios "GoogleService-Info.plist" ("ios-out" flag.) relative to the root of your Flutter project. Example input: ios/dev and waits for user input. This is the same behaviour as running the command without the --ios-out

Flutter doctor for Windows & MacOS :

Windows [√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [version 10.0.22631.4169], locale fr-CA) • Flutter version 3.24.3 on channel stable at C:\Users\jmg\fvm\versions\3.22.3 • Upstream repository https://github.com/flutter/flutter.git • Framework revision 2663184aa7 (12 days ago), 2024-09-11 16:27:48 -0500 • Engine revision 36335019a8 • Dart version 3.5.3 • DevTools version 2.37.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at C:\Users\jmg\AppData\Local\Android\sdk • Platform android-34, build-tools 34.0.0 • Java binary at: C:\Program Files\Android\Android Studio1\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314) • All Android licenses accepted.

[√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Professional 2022 17.7.4) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Professional • Visual Studio Professional 2022 version 17.7.34031.279 • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2024.1) • Android Studio at C:\Program Files\Android\Android Studio1 • 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 17.0.11+0--11852314)

[√] VS Code, 64-bit edition (version 1.93.1) • VS Code at C:\Program Files\Microsoft VS Code • Flutter extension version 3.96.0

[√] Connected device (4 available) • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 14 (API 34) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [version 10.0.22631.4169] • Chrome (web) • chrome • web-javascript • Google Chrome 128.0.6613.120 • Edge (web) • edge • web-javascript • Microsoft Edge 129.0.2792.52

[√] Network resources • All expected network resources are available.

MacOS

[✓] Flutter (Channel stable, 3.24.3, on macOS 14.7 23H124 darwin-arm64, locale fr-CA) • Flutter version 3.24.3 on channel stable at /Users/jmguazzo/dev/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 2663184aa7 (12 days ago), 2024-09-11 16:27:48 -0500 • Engine revision 36335019a8 • Dart version 3.5.3 • DevTools version 2.37.3

[✗] Android toolchain - develop for Android devices ✗ Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/to/macos-android-setup for detailed instructions). If the Android SDK has been installed to a custom location, please use flutter config --android-sdkto update to that location.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15F31d • CocoaPods version 1.15.2

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) not find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/to/macos-android-setup for detailed instructions).

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

[✓] Connected device (4 available) • iPhone 15 Pro (mobile) • 3D098364-15AD-4424-BDB4-6429267093F7 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-5 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 14.7 23H124 darwin-arm64 • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.7 23H124 darwin-arm64

[✓] Network resources • All expected network resources are available.

or found issues in 3 categories.

jmguazzo avatar Sep 23 '24 22:09 jmguazzo

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

github-actions[bot] avatar Oct 21 '24 22:10 github-actions[bot]

@maRci002 - Have you tried the latest dev version?

dart pub global activate flutterfire_cli 1.0.1-dev.4

@russellwheatley neither --ios-out ios/firebase_config/dev neither --ios-out ios/firebase_config/dev/GoogleService-Info.plist worked for me. The firebase_app_id_file.json also stopped generating. However firebase.json is generated at the root of the project and to be honest idk what is that file.

maRci002 avatar Oct 22 '24 08:10 maRci002

Same story here. All files are created or modified. Except for IOS... 😢

rikkertpm avatar Nov 14 '24 19:11 rikkertpm

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

github-actions[bot] avatar Dec 12 '24 20:12 github-actions[bot]

same here

Ianmuhia avatar Mar 30 '25 10:03 Ianmuhia

@maRci002 - firebase_app_id_file .json is no longer needed in your source control. firebase.json tracks your FlutterFire configuration. Once you've configured (flutterfire configure), it allows you to run flutterfire reconfigure without providing any arguments and it will update your config files if you have enabled other firebase services.

I cannot reproduce this bug if I'm honest. Did you get to the bottom of it?

russellwheatley avatar Apr 15 '25 10:04 russellwheatley

firebase.json tracks your FlutterFire configuration

It's nice to see that it can store configuration for each flavor

I cannot reproduce this bug if I'm honest. Did you get to the bottom of it?

Unfortunately, version 1.2.0 also doesn't fix the issue. I even tried running the cmd as administrator.

I'm monitoring the firebase.json file, and I can see entries for android and dart, but nothing for ios. For example, android has buildConfigurations and fileOutput, but there's no equivalent section for ios.

Is there any way to force flutterfire to be more verbose, so I can get more insight into what's going wrong?

maRci002 avatar Apr 15 '25 12:04 maRci002

Same problem when running new version of flutterfire_cli from Linux. Didnt use to be like this.

Looking at the source code, the problem seems to be that the iOS files are only generated on a mac.

mortenthansen avatar May 26 '25 21:05 mortenthansen

Just to be clear - as @mortenthansen has pointed out, we only generate apple stuff if you're running on macOS. I've just noticed that @maRci002 is running on windows which is why you're not seeing GoogleService-Info.plist generated.

russellwheatley avatar Jun 13 '25 10:06 russellwheatley

Just to be clear - as @mortenthansen has pointed out, we only generate apple stuff if you're running on macOS. I've just noticed that @maRci002 is running on windows which is why you're not seeing GoogleService-Info.plist generated.

Strange since old version could handle it, can you please show some warning messages on the other platforms or document it?

maRci002 avatar Jun 13 '25 13:06 maRci002

@russellwheatley can you please provide the rationale for why this is the case that GoogleService-Info.plist would be generated only when running on macOS? I see the relevant condition line but there is no comment as to why this is happening. This is weird as if I understand correctly the file actually gets generated on the server-side and simply dumped. Specifically, this is not mentioned in Google's docs for setting up Firebase with Flutter using Flutterfire CLI, so it might be at least beneficial to specify this explicitly.

yuval-ngtnuma avatar Aug 19 '25 10:08 yuval-ngtnuma

@yuval-ngtnuma - It is documented here

russellwheatley avatar Aug 20 '25 08:08 russellwheatley