invertase / flutterfire_cli

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

[bug]: flutterfire corrupts Xcode build steps #297

Closed mattbodley closed 1 month ago

mattbodley commented 1 month ago

Is there an existing issue for this?

CLI Version

1.0.0

Firebase Tools version

13.0.2

Flutter Doctor Output

[✓] Flutter (Channel stable, 3.19.6, on macOS 14.3.1 23D60 darwin-arm64, locale en-US) • Flutter version 3.19.6 on channel stable at /Users/mattbodley/development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 54e66469a9 2024-04-17 13:08:03 -0700 • Engine revision c4cd48e186 • Dart version 3.3.4 • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/mattbodley/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874) • All Android licenses accepted.

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

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

[✓] Android Studio (version 2023.2) • 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 17.0.9+0-17.0.9b1087.7-11185874)

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

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

• No issues found!

Description

My XCode already has [firebase_crashlytics] Crashlytics Upload Symbols setup as per https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=flutter&authuser=4&hl=en#run-script-exists and https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=flutter&authuser=4&hl=en#run-script-does-not-exist

But the script is added anyway and it does not have any files in the "Inptu Files section" which seems to have duplicate targets for output and causes a build error

Steps to reproduce

  1. Have an existing script called [firebase_crashlytics] Crashlytics Upload Symbols based off https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=flutter&authuser=4&hl=en#run-script-exists and https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=flutter&authuser=4&hl=en#run-script-does-not-exist
  2. Run flutterfire_cli configure
  3. Build xcode

Expected behavior

It should work like normal but instead outputs errors

Screenshots

Screenshot 2024-05-20 at 12 54 47

Screenshot 2024-05-20 at 12 54 57

Screenshot 2024-05-20 at 12 55 07

Additional context and comments

No response

russellwheatley commented 1 month ago

@mattbodley - You don't need to manually add the upload symbols script when you use flutterfire configure. You don't need input files. The script takes care of uploading symbols.

I am not sure it is causing your build errors either. I don't know how it would do that. If the script fails, the build will fail. I don't see anything in the build logs that suggest it is coming from the script.

mattbodley commented 1 month ago

ah you are right @russellwheatley I enabled debugging and it was failing because I needed to activate flutterfire_cli on the command line, I think all good to close this but I think may be better to turn into a feature request, as the other script was added automatically via some install of firebase_crashlytics and it should prompt the user to remove it to replace it, rather than doing it manually, e.g. perhaps keep it if the user prefers to keep the old version as it may be modified with custom code

russellwheatley commented 1 month ago

@mattbodley - we only add the script if you have an app_id_file.json (legacy) in the root of the project. Otherwise, it is not installed. Thank you for confirming it is not a bug 🙏