invertase / invertase/flutterfire_cli

[bug]: (Pub workspaces & Melos) dSYM upload fails | uploadDebugSymbols = false

Open
#403 1 comment 1 reaction 0 assignees View on GitHub
blocked: customer-response bug enhancement keep open
Dominant language
Dart
Stars
193
Forks
74
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues.

### CLI Version

1.2.0

### Firebase Tools version

13.28.0

### Flutter Doctor Output

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.32.0, on macOS 15.5 24F74 darwin-arm64, locale en-ES)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] VS Code (version 1.100.3)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

### Description

I'm not adding the full `flutter doctor -v` output as I believe it's not relevant for this issue.
Please, let me know otherwise.

Regardless if I stated on the title "Pub workspaces", this would also occur just using old Melos version or with any other project structure that varies from default.

**Going straight to the point:**
The function `addFlutterFireDebugSymbolsScript` at `packages/flutterfire_cli/lib/src/firebase/firebase_apple_writes.dart` is unable to find `firebase_crashlytics` dependency on a different project structure than the usual one.

**Details:**
With the recently introduced "Pub workspaces", `.dart_tool/package_config.json` resides at the root of the project, which is not the `flutterAppPath`.

For instance, we have the main app at `./apps/name` as recommended by Melos or Pub dev if I'm not wrong.

Despite the fact that `addFlutterFireDebugSymbolsScript` tries to find the dependency also in the "main app" `pubspec.yaml`, the `firebase_crashlytics` dependency might not be there, as following a typical "workspace" structure, the developer could have delegated all that logic to an internal package at `./packages/[name]`.

This is exactly our case, so ultimately, since no `firebase_crashlytics` dependency was found, `uploadDebugSymbols` is being set as `false` in the "main app" `firebase.json` file.

Additionally to that, the build phase script is also not generated.

**Current fix:**
We just added `firebase_crashlytics` dependency back to our "main app" `pubspec.yaml`, which is now redundant.

**Potential fix:**
Instead of looking up for `package_config.json` or trying to figure out if the project follows a "workspace" structure, I recommend that the CLI simply provides a new option such as `--app-dir`.

This way, we can just run `flutterfire configure / reconfigure` from the root.

### Steps to reproduce

As explained above.

### Expected behavior

The CLI should detect the `firebase_crashlytics` dependency.

### Screenshots

_No response_

### Additional context and comments

This [issue](https://github.com/firebase/flutterfire/issues/13831#issuecomment-2476988228), closed by the OP, pointed me to the right direction.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.