invertase/flutterfire_cli

[bug]: Upload Crashlytics Symbols dSYM Files NOT working!

Closed this issue · 23 comments

Is there an existing issue for this?

  • I have searched the existing issues.

CLI Version

1.0.0

Firebase Tools version

13.11.2

Flutter Doctor Output

image

Description

I followed the Firebase Crashlytics setup guide for Flutter to integrate Firebase Crashlytics into my Flutter app. While I am able to see crash reports and user metrics in the Firebase Analytics dashboard, the dSYM files are not being uploaded automatically.

Steps to reproduce

  1. Follow the official Firebase Crashlytics setup guide for Flutter.
  2. Complete all the steps as instructed, including adding the necessary dependencies and setting up the Crashlytics SDK.
  3. Run the app and force a crash to test the integration.
  4. Check the Firebase Analytics dashboard for crash reports and user metrics.

Expected behavior

The dSYM files should be uploaded automatically without any manual intervention.

Actual Behavior:
Although crash reports and user metrics appear in the Firebase Analytics dashboard, the dSYM files are not uploaded automatically.

Screenshots

image

image

image

Additional context and comments

Flutter version: 3.22.2
Firebase Crashlytics version: ^4.0.1
Xcode version: 15.4

I am also experiencing this. Have been since May 29th when I first integrated crashlytics -- have not had a successful dsym upload yet despite logs showing the script finishing successfully.

Additionally, flutterfire configure does not add the input files that the iOS instructions say are required -- and if you manually add them, running flutterfire configure overrides it and removes them. However, manually adding the input files still does not solve the uploading issue.

We're getting the same - I've tried spitting out the logs as described in #249 and they suggest the upload is successful:

Running upload-symbols in Build Phase mode
Validating build environment for Crashlytics...
Processing dSYMs...
Successfully submitted symbols for architecture x86_64 with UUID 36303faa3e1f34a5ba0279f924182260 in dSYM: /Users/[..]/build/ios/Debug-development-iphonesimulator/Runner.app.dSYM
�[32mSuccessfully uploaded Crashlytics build event and symbols�[0m
Running upload-symbols in Build Phase mode
Validating build environment for Crashlytics...
Processing dSYMs...
Successfully submitted symbols for architecture x86_64 with UUID 36303faa3e1f34a5ba0279f924182260 in dSYM: /Users/[..]/build/ios/Debug-development-iphonesimulator/Runner.app.dSYM
�[32mSuccessfully uploaded Crashlytics build event and symbols�[0m

But the dSYM(s) never appear in the Firebase console.

If helpful, we're using Very Good CLI, so we have build flavours for production, staging and development, and a Firebase project per environment. This also means we don't have a permanent top-level GoogleService-Info.plist, but rather copy in an environment-specific version at build time. I've not tried to manually configure the input files for the build phase (yet!).

We're getting the same - I've tried spitting out the logs as described in #249 and they suggest the upload is successful:

Running upload-symbols in Build Phase mode
Validating build environment for Crashlytics...
Processing dSYMs...
Successfully submitted symbols for architecture x86_64 with UUID 36303faa3e1f34a5ba0279f924182260 in dSYM: /Users/[..]/build/ios/Debug-development-iphonesimulator/Runner.app.dSYM
�[32mSuccessfully uploaded Crashlytics build event and symbols�[0m
Running upload-symbols in Build Phase mode
Validating build environment for Crashlytics...
Processing dSYMs...
Successfully submitted symbols for architecture x86_64 with UUID 36303faa3e1f34a5ba0279f924182260 in dSYM: /Users/[..]/build/ios/Debug-development-iphonesimulator/Runner.app.dSYM
�[32mSuccessfully uploaded Crashlytics build event and symbols�[0m

But the dSYM(s) never appear in the Firebase console.

If helpful, we're using Very Good CLI, so we have build flavours for production, staging and development, and a Firebase project per environment. This also means we don't have a permanent top-level GoogleService-Info.plist, but rather copy in an environment-specific version at build time. I've not tried to manually configure the input files for the build phase (yet!).

@michaelowolf
I tried running the command:
flutter build ios --obfuscate --split-debug-info=./ios-build

The console indicated that everything worked fine, and I received the output:

Screenshot 2024-06-20 at 1 20 21 PM

However, when I checked Firebase Crashlytics, I found that the dSYM(s) were not uploaded.

image

Additionally, flutterfire configure does not add the input files that the iOS instructions say are required -- and if you manually add them, running flutterfire configure overrides it and removes them. However, manually adding the input files still does not solve the uploading issue.

Exactly, @DougSig .
That's what I tried to do. I added all the steps manually and attempted to upload the dSYM files, but they still didn't upload! :(

Hey @Shatha-Naami - as mentioned here, please check to see if that file is missing. Could other folks experiencing this issue also let me know if that file is missing. Thanks 🙏

Hey @Shatha-Naami - as mentioned here, please check to see if that file is missing. Could other folks experiencing this issue also let me know if that file is missing. Thanks 🙏

Hey @russellwheatley, I have a version of app_id_file.json at .dart_tool/flutterfire/platforms/ios/targets/Runner/{Firebase project id}/app_id_file.json for my development Firebase project (of which the contents look correct), but no equivalent for my production Firebase project (although IIRC, neither development nor production were uploading the dSYMs).

Hey @Shatha-Naami - as mentioned here, please check to see if that file is missing. Could other folks experiencing this issue also let me know if that file is missing. Thanks 🙏

Hey @russellwheatley,
When I checked my app, unfortunately, I didn't find the file.
I'm sure I followed all the steps in the documentation, so how can I generate the file?

image

@Shatha-Naami - what version of FlutterFire CLI are you using? The script is added to your build phases and it generates the file when you build you app (or uses existing file if you have built app previously). It is then used to upload symbols.

@michaelowolf - you said you were using VGV CLI? They set their apps up to use build configuration. You should probably be configuring your app to use build configuration instead of target. In other words, use this flag - --ios-build-config= instead of --ios-target=. Unless you have some custom setup of course which doesn't make use of build configuration.

@Shatha-Naami - what version of FlutterFire CLI are you using? The script is added to your build phases and it generates the file when you build you app (or uses existing file if you have built app previously). It is then used to upload symbols.

@russellwheatley
The version of FlutterFire CLI is --> 1.0.0

After following this document and checking Xcode's Build Phases, I found that this run script was generated automatically and not created manually.
I didn't use any previously built files.

image

Hi, I have been experiencing the same issue and that's just after freshly installing everything - new mac, new flutter, new xcode, new project. It's very easily reproducable, please look into it. Thank you for your time and effort.

The issue in question: firebase/flutterfire#12990

There is a duplicate of this already:

  1. #321

@tpkowastaken
Thanks for your support!.

I follow your steps, and this is the final result:

image image

and I'm already update values on firebase_app_id_file.json
once moving to crashlytics tab in firebase, still show to me
This app has 352 unprocessed crashes. Upload 17 dSYM files to process them.

So what I miss in the steps?

@Shatha-Naami
I'm terribly sorry the solution doesn't work. I tried to use an older system that was supplied by an older flutterfire cli version hovewer since i checked the For install builds only option it only runs when building an ipa file. I tested it only by building xcarchive which didn't upload the symbols. I'm going to debug it further and hopefully bring results. Thank you for your patience.

I encountered the same issue. After investigating the source code:(

Future<ConfigurationResults> _getConfigurationFromFirebaseJsonFile() async {

I noticed that there are three options buildConfiguration, target, defaultConfig. By default flutterfire currently uses defaultConfig and also sets up the project like that. More specific, the command flag added to the xcodeproj uses the defaultConfig which in turn uses the default configuration in the firebase.json file.

In order to make multi flavor setups working you need to change the firebase.json to uses targets instead of default:

{
  "flutter": {
    "platforms": {
      "ios": {
        "default": {
          "projectId": "your-project-id",
          "appId": "1:1:ios:1",
          "uploadDebugSymbols": false,
          "fileOutput": "ios/Runner/GoogleService-Info.plist"
        }
      },
      "dart": {
        "lib/firebase_options.dart": {
          "projectId": "your-project-id",
          "configurations": {
            "ios": "1:1:ios:1"
          }
        }
      }
    }
  }
}

to

{
  "flutter": {
    "platforms": {
      "ios": {
        "targets": {
          "develop": {
            "projectId": "your-project-id-develop",
            "appId": "1:1:ios:1",
            "uploadDebugSymbols": true,
            "fileOutput": "ios/Runner/GoogleService-Info.plist"
          },
          "production": {
            "projectId": "your-project-id",
            "appId": "1:1:ios:1",
            "uploadDebugSymbols": true,
            "fileOutput": "ios/Runner/GoogleService-Info.plist"
          }
        }
      },
      "dart": {
        "lib/firebase_options.develop.dart": {
          "projectId": "your-project-id-develop",
          "configurations": {
            "ios": "1:1:ios:1"
          }
        },
        "lib/firebase_options.production.dart": {
          "projectId": "your-project-id",
          "configurations": {
            "ios": "1:1:ios:1"
          }
        }
      }
    }
  }
}

Furthermore in the FlutterFire: "flutterfire upload-crashlytics-symbols" build phase (in XCode > Runner > Runner (Targets) > Build Phases) replace the --default-config=default with --target=${FLAVOR} ($FLAVOR being a user defined build setting added by me).

All those changes should result in a app_id_file.json located in .dart_tool/flutterfire/platforms/ios/targets/... after running the app. (Make sure to run a flutter clean && flutter pub get before)
If so, the symbols should be uploaded - if not - check that you don't have any typos (it won't give you an error).

Hope this helps.

@RaphaelJenni
Thanks for help.
But I'm using a single flavor in my app default flavor, not multiple flavors.

@Shatha-Naami Update the firebase dependencies to the newest version and run flutterfire configure. This should generate a new Build Step (you can delete the old one). The new build step doesn't depend on the firebase_app_id_file.json anymore. Hope this helps.

@Shatha-Naami Update the firebase dependencies to the newest version and run flutterfire configure. This should generate a new Build Step (you can delete the old one). The new build step doesn't depend on the firebase_app_id_file.json anymore. Hope this helps.

@RaphaelJenni
I upgraded the Firebase dependencies to the latest versions and ran flutterfire configure.
After deleting all old files, I checked Crashlytics on Firebase. A crash was reported!

image

Thanks All!

@Shatha-Naami I'm terribly sorry the solution doesn't work. I tried to use an older system that was supplied by an older flutterfire cli version hovewer since i checked the For install builds only option it only runs when building an ipa file. I tested it only by building xcarchive which didn't upload the symbols. I'm going to debug it further and hopefully bring results. Thank you for your patience.

Confirmed that this helped, without need to change any Firebase package version or even cleaning project again.

uild-config

@russellwheatley sorry to necro this - just wanted to mention that (having finally had time to come back to this) your suggestion worked. Thanks for the help with that, I'd missed completely the multi-build configuration set up section in the README.

Probably not the right place to mention this (and I may be missing more docs elsewhere!), but since https://firebase.flutter.dev/docs/overview/ is marked out of date and points to https://firebase.google.com/docs/flutter/setup, it would be really good to get some of the Flutterfire CLI readme included in or linked to from those Firebase docs.

@RaphaelJenni I am using flavors in my project and I tried to use your solution:

I encountered the same issue. After investigating the source code:(

Future<ConfigurationResults> _getConfigurationFromFirebaseJsonFile() async {

I noticed that there are three options buildConfiguration, target, defaultConfig. By default flutterfire currently uses defaultConfig and also sets up the project like that. More specific, the command flag added to the xcodeproj uses the defaultConfig which in turn uses the default configuration in the firebase.json file.

In order to make multi flavor setups working you need to change the firebase.json to uses targets instead of default:

{
  "flutter": {
    "platforms": {
      "ios": {
        "default": {
          "projectId": "your-project-id",
          "appId": "1:1:ios:1",
          "uploadDebugSymbols": false,
          "fileOutput": "ios/Runner/GoogleService-Info.plist"
        }
      },
      "dart": {
        "lib/firebase_options.dart": {
          "projectId": "your-project-id",
          "configurations": {
            "ios": "1:1:ios:1"
          }
        }
      }
    }
  }
}

to

{
  "flutter": {
    "platforms": {
      "ios": {
        "targets": {
          "develop": {
            "projectId": "your-project-id-develop",
            "appId": "1:1:ios:1",
            "uploadDebugSymbols": true,
            "fileOutput": "ios/Runner/GoogleService-Info.plist"
          },
          "production": {
            "projectId": "your-project-id",
            "appId": "1:1:ios:1",
            "uploadDebugSymbols": true,
            "fileOutput": "ios/Runner/GoogleService-Info.plist"
          }
        }
      },
      "dart": {
        "lib/firebase_options.develop.dart": {
          "projectId": "your-project-id-develop",
          "configurations": {
            "ios": "1:1:ios:1"
          }
        },
        "lib/firebase_options.production.dart": {
          "projectId": "your-project-id",
          "configurations": {
            "ios": "1:1:ios:1"
          }
        }
      }
    }
  }
}

Furthermore in the FlutterFire: "flutterfire upload-crashlytics-symbols" build phase (in XCode > Runner > Runner (Targets) > Build Phases) replace the --default-config=default with --target=${FLAVOR} ($FLAVOR being a user defined build setting added by me).

All those changes should result in a app_id_file.json located in .dart_tool/flutterfire/platforms/ios/targets/... after running the app. (Make sure to run a flutter clean && flutter pub get before) If so, the symbols should be uploaded - if not - check that you don't have any typos (it won't give you an error).

Hope this helps.

I tried to use your way because I am also using flavors. After doing the changes I am unable to run my project. Throws error: Could not build the precompiled application for the device. Error (Xcode): 'Flutter/Flutter.h' file not found

Can you please share the User defined flavor setup screenshot? and FlutterFire script needs to run at last in build phase?
This is my Script: #!/bin/bash PATH="${PATH}:$FLUTTER_ROOT/bin:$HOME/.pub-cache/bin" flutterfire upload-crashlytics-symbols --upload-symbols-script-path="$PODS_ROOT/FirebaseCrashlytics/upload-symbols" --platform=ios --apple-project-path="${SRCROOT}" --env-platform-name="${PLATFORM_NAME}" --env-configuration="${CONFIGURATION}" --env-project-dir="${PROJECT_DIR}" --env-built-products-dir="${BUILT_PRODUCTS_DIR}" --env-dwarf-dsym-folder-path="${DWARF_DSYM_FOLDER_PATH}" --env-dwarf-dsym-file-name="${DWARF_DSYM_FILE_NAME}" --env-infoplist-path="${INFOPLIST_PATH}" --target=${FLAVOR}
My user defined Flavor setup:
Screenshot 2024-10-31 at 1 50 43 PM