firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.61k stars 3.95k forks source link

[firebase_crashlytics]: java.io.IOException: Breakpad symbol generation failed (exit=1) by GitHub Actions #13170

Closed alpha2048 closed 1 week ago

alpha2048 commented 1 month ago

Is there an existing issue for this?

Which plugins are affected?

Crashlytics

Which platforms are affected?

Android

Description

When I upload crashlytics symbols generated by Flutter Android build in GitHub Actions (ubuntu-latest), BreakPad error occurs.

Reproducing the issue

Sample Repository: https://github.com/alpha2048/flutter_firebase_crashlytics_test/tree/feature/flutterfire

Reproduce Step:

  1. flutter create
  2. add firebase_core, firebase_crashlytics to pubspec.yaml
  3. Github Actions: build apk with those options: -obfuscate, --split-debug-info
  4. Github Actions: crashlytics:symbols:upload with w9jds/firebase-action@v13.15.0

Firebase Core version

2.31.0 3.3.0

Flutter Version

3.22.2

Relevant Log Output

java.io.IOException: Breakpad symbol generation failed (exit=1), see STDERR
    at com.google.firebase.crashlytics.buildtools.ndk.internal.breakpad.BreakpadSymbolGenerator.generateSymbols(BreakpadSymbolGenerator.java:129)
    at com.google.firebase.crashlytics.buildtools.Buildtools.generateNativeSymbolFiles(Buildtools.java:306)
    at com.google.firebase.crashlytics.buildtools.CommandLineHelper.executeGenerateSymbols(CommandLineHelper.java:193)
    at com.google.firebase.crashlytics.buildtools.CommandLineHelper.executeCommand(CommandLineHelper.java:125)
    at com.google.firebase.crashlytics.buildtools.CommandLineHelper.main(CommandLineHelper.java:72)
    at com.google.firebase.crashlytics.buildtools.Buildtools.main(Buildtools.java:114)

Error: java command failed with args: -jar,/github/home/.cache/firebase/crashlytics/buildtools/crashlytics-buildtools-3.0.2.jar,-symbolGenerator,breakpad,-symbolFileCacheDir,/tmp/crashlytics-7e5def19-0756-4885-86d6-b898c867ed4a/nativeSymbols/1-88925584673-android-5e29e631a333787113d260/breakpad,-verbose,-generateNativeSymbols,-unstrippedLibrary,outputs,-clientName,firebase-cli;crashlytics-buildtools

Flutter dependencies

Expand Flutter dependencies snippet
```yaml Replace this line with the contents of your `flutter pub deps -- --style=compact`. ```

Additional context and comments

If I use an older firebase-action, e.g. v13.10.2, it succeeds. Also, if I upload it from my Mac with the new CLI, it succeeds too.

I don't know what's causing the error. It might be a problem with firebase-action. Sorry, but I'll put it here first.

Lyokone commented 1 month ago

Hello, you are using an old version of Firebase Core (and potentially crashlytics but didn't fill out the Flutter Dependencies part). Please update to the latest version and report back.

alpha2048 commented 1 month ago

@Lyokone Hi, I updated the library to the latest version and still the same problem occurs.

https://github.com/alpha2048/flutter_firebase_crashlytics_test/blob/main/pubspec.yaml https://github.com/alpha2048/flutter_firebase_crashlytics_test/actions/runs/10362231794

alpha2048 commented 3 weeks ago

Hi, any updates? @Lyokone I also create an example that reproduces this issue using the firebase_crashlytics example in flutterfire. https://github.com/alpha2048/flutter_firebase_crashlytics_test_2 https://github.com/alpha2048/flutter_firebase_crashlytics_test_2/actions/runs/10438117026/job/28905066500

kewitschka commented 3 weeks ago

For me it works when I set the following path --split-debug-info=build/app/outputs/symbols. When I use the root of my project as path I get java.io.IOException: No native libraries found at <root/path>

alpha2048 commented 3 weeks ago

I change split-debug-info path to it, but still getting the same issue. https://github.com/alpha2048/flutter_firebase_crashlytics_test_2/actions/runs/10452789994/job/28941942809 Is it small mistake? Does anyone else face a similar problem?

myohei commented 1 week ago

The firebase-tools used by w9jds/firebase-action are not compatible with Crashlytics. Installing and using firebase cli worked!

      - name: Install firebase CLI
        run: curl -sL https://firebase.tools | bash
      - name: export GOOGLE_APPLICATION_CREDENTIALS_JSON
        run: echo ${{ secrets.FIREBASE_CREDENTIAL_FILE_BASE64 }} > /tmp/google_application_credentials.json
      - name: Upload symbols to firebase crashlytics
        run: firebase crashlytics:symbols:upload --app=${{ secrets.FIREBASE_APP_ID }} build/app/outputs/symbols
        env:
          GOOGLE_APPLICATION_CREDENTIALS: /tmp/google_application_credentials.json
alpha2048 commented 1 week ago

@myohei Hi, I followed your suggestion and it was successful! Thank you for your support. https://github.com/alpha2048/flutter_firebase_crashlytics_test_2/actions/runs/10668122043/job/29567129017

I don't know why there is such a difference, but maybe it's not flutterfire problem, so I'm going to close this issue. I might discuss this further in firebase-actions.