firebase / firebase-tools

The Firebase Command Line Tools
MIT License
3.97k stars 916 forks source link

Firebase-tools v13.11.0 has crashlytics buildtools v3 that does not work on Intel-based Macs #7292

Closed Altair4Ru closed 1 week ago

Altair4Ru commented 3 weeks ago

[REQUIRED] Environment info

firebase-tools: 13.11.0+ Platform: MacOS

[REQUIRED] Test case

The thing is, Crashlytics buildtools v3 now have dump_syms.bin for MacOS built for arm64 arch only, while it should be built as a universal binary

.//firebase-crashlytics-buildtools-2.9.9/dump_syms/macos/dump_syms.bin:   Mach-O 64-bit executable x86_64
.//firebase-crashlytics-buildtools-3.0.0/dump_syms/macos/dump_syms.bin:   Mach-O 64-bit executable arm64

[REQUIRED] Steps to reproduce

Just call firebase-tools -- firebase crashlytics:symbols:upload --app={app_id_here} on Intel-based Mac

[REQUIRED] Expected behavior

The symbols got uploaded without any errors

[REQUIRED] Actual behavior

[CRASHLYTICS LOG DEBUG] Crashlytics Buildtools initialized.
[CRASHLYTICS LOG DEBUG] Extracting dump_syms from dump_syms/macos/dump_syms.bin to /<ProjectPath>/.crashlytics/dump_syms.bin
[CRASHLYTICS LOG DEBUG] Breakpad symbol generator initialized: /<ProjectPath>/.crashlytics/dump_syms.bin
...
java.io.IOException: Cannot run program "/<ProjectPath>/.crashlytics/dump_syms.bin": error=86, Bad CPU type in executable
  at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
  at com.google.firebase.crashlytics.buildtools.ndk.internal.breakpad.BreakpadSymbolGenerator.generateSymbols(BreakpadSymbolGenerator.java:119)
  at com.google.firebase.crashlytics.buildtools.Buildtools.generateNativeSymbolFiles(Buildtools.java:306)
  at com.google.firebase.crashlytics.buildtools.Buildtools.generateNativeSymbolFiles(Buildtools.java:280)
  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)
Caused by: java.io.IOException: error=86, Bad CPU type in executable
  at java.lang.UNIXProcess.forkAndExec(Native Method)
  at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
  at java.lang.ProcessImpl.start(ProcessImpl.java:134)
  at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
  ... 7 more
aalej commented 3 weeks ago

Hey @Altair4Ru, thanks for reporting this. Some of the folks from our team with an macOS Intel machine were able to reproduce the issue. Let me raise this to our engineering team so they can take a look.

mrober commented 3 weeks ago

I have a fix for this, it will be included in the next version of the Firebase CLI tool. For now you can manually tell it to use the latest buildtools by:

  1. Download firebase-crashlytics-buildtools-3.0.2.jar.

  2. Tell the Firebase CLI tool to use the jar by setting the environment variable:

    export CRASHLYTICS_LOCAL_JAR=/path/to/firebase-crashlytics-buildtools-3.0.2.jar
  3. Run the Firebase CLI tool in debug mode:

    firebase crashlytics:symbols:upload --debug --app=FIREBASE_APP_ID /path/to/symbols

    If you see a line in debug like "[CRASHLYTICS LOG DEBUG] Skipping dumpsyms extraction, file exists: /path/to/.crashlytics/dump_syms.bin", delete that file. It is the old dump_syms binary from the old buildtools jar. Then try this step again.

joehan commented 1 week ago

Fixed by #7357