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 upload-crashlytics-symbols didn't respect the --yes directive and always edit file even if already set #157

Closed EArminjon closed 8 months ago

EArminjon commented 1 year ago

Is there an existing issue for this?

CLI Version

0.3.0-dev.16

Firebase Tools version

9.23.1

Flutter Doctor Output

[✓] Flutter (Channel stable, 3.3.4, on macOS 13.2.1 22D68 darwin-arm, locale fr-FR) • Flutter version 3.3.4 on channel stable at /Users/enguerrandarminjon/fvm/versions/3.3.4 • Upstream repository https://github.com/flutter/flutter.git • Framework revision eb6d86ee27 (5 months ago), 2022-10-04 22:31:45 -0700 • Engine revision c08d7d5efc • Dart version 2.18.2 • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/enguerrandarminjon/Library/Android/sdk • Platform android-33, build-tools 30.0.3 • ANDROID_HOME = /Users/enguerrandarminjon/Library/Android/sdk • ANDROID_SDK_ROOT = /Users/enguerrandarminjon/Library/Android/sdk • Java binary at: /Users/enguerrandarminjon/Library/Java/JavaVirtualMachines/corretto-1.8.0_322/Contents/Home/bin/java • Java version OpenJDK Runtime Environment Corretto-8.322.06.1 (build 1.8.0_322-b06) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14C18 • CocoaPods version 1.11.3

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

[!] Android Studio (version 2022.1) • Android Studio at /Users/enguerrandarminjon/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/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 ✗ Unable to find bundled Java version. • Try updating or re-installing Android Studio.

[✓] Connected device (3 available) • SIMU IPHONE 14 PRO (mobile) • 23B8F2A1-1290-4948-92F1-50149FF75D26 • ios • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 13.2.1 22D68 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.177

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

! Doctor found issues in 1 category.

Description

When running flutterfire configure with the yes flag i see the following prompt query:

? Do you want an 'FlutterFire: "flutterfire upload-crashlytics-symbols"' adding to the build phases of your iOS project? (y/n) › 

This behavior didn't respect the yes flag.

Steps to reproduce

run flutterfire configure with some parameters (see screenshot) and add the yes flag.

Expected behavior

Command should end successfully without waiting a prompt and without editing any project file if upload-crashlytics-symbols phase already set.

Actually the writting of the phase 'flutterfire upload-crashlytics-symbols' always edit the following file : ios/Runner.xcodeproj/project.pbxproj

Screenshots

Capture d’écran 2023-03-02 à 13 48 41

Additional context and comments

My app have many flavors (scheme).

russellwheatley commented 8 months ago

Use the latest FlutterFire version as it will auto detect if Crashlytics dependenct is present, and it will insert the Crashlytics upload symbols script automatically.

Install latest version:

dart pub global activate flutterfire_cli 0.3.0-dev.18 --overwrite