Search code examples
androidflutterfirebasemacoscrashlytics

Crashlytics upload symbols- "java command failed with args" -how fix it?


I have flutter app. I working on mac. I used obfuscation for my appbundle. I get logs for Crashlytics in unreadable form. I found that it is necessary to load symbols on Crashlytics(Firebase). I installed Firebase cli and got my app id. I run it command:

firebase crashlytics:symbols:upload --app myId debug-info/app.android-arm64.symbols

But I have error, This is logs:

i  Generating symbols for debug-info-droid/app.android-arm64.symbols
i  Generated symbols for debug-info-droid/app.android-arm64.symbols
.......
i  Uploading all generated symbols...
[CRASHLYTICS LOG DEBUG] PUT headers:
[CRASHLYTICS LOG DEBUG]         User-Agent = firebase-cli;crashlytics-buildtools/2.9.2
[CRASHLYTICS LOG DEBUG]         X-CRASHLYTICS-API-CLIENT-TYPE = firebase-cli;crashlytics-buildtools
[CRASHLYTICS LOG DEBUG]         X-CRASHLYTICS-API-CLIENT-VERSION = 2.9.2
[CRASHLYTICS LOG DEBUG] PUT response: [reqId=null] 400
......
response: 400 HTTP/1.1 400 Bad Request]
        at com.google.firebase.crashlytics.buildtools.api.RestfulWebApi.sendFile(RestfulWebApi.java:109)
        at com.google.firebase.crashlytics.buildtools.api.RestfulWebApi.uploadFile(RestfulWebApi.java:119)
        at com.google.firebase.crashlytics.buildtools.api.FirebaseSymbolFileService.uploadNativeSymbolFile(FirebaseSymbolFileService.java:35)
        at com.google.firebase.crashlytics.buildtools.Buildtools.uploadNativeSymbolFiles(Buildtools.java:301)
        at com.google.firebase.crashlytics.buildtools.CommandLineHelper.executeUploadSymbols(CommandLineHelper.java:194)
        at com.google.firebase.crashlytics.buildtools.CommandLineHelper.executeCommand(CommandLineHelper.java:120)
        at com.google.firebase.crashlytics.buildtools.CommandLineHelper.main(CommandLineHelper.java:65)
        at com.google.firebase.crashlytics.buildtools.Buildtools.main(Buildtools.java:111)
Error: java command failed with args: -jar,/Users/rockstar/.cache/firebase/crashlytics/buildtools/crashlytics-buildtools-2.9.2.jar,-symbolGenerator,breakpad,-symbolFileCacheDir,/var/folders/jg/../nativeSymbols/.../breakpad,-verbose,-uploadNativeSymbols,-googleAppId,myId,-clientName,
firebase-cli;crashlytics-buildtools

how can i fix this problem?

is it related to java settings on my mac?

maybe i can use another solution to uploading symbols?


Solution

  • I also spent weeks on that!

    As per https://firebase.google.com/docs/crashlytics/get-started?platform=flutter#add-sdk, the command is:

    firebase crashlytics:symbols:upload --app=APP_ID PATH/TO/symbols
    

    It seems the APP_ID you provided is malformed, so you get a "[reqId=null] error".

    Do not use your app id formatted like "com.myflutterapp".

    Find your app_id in the Firebase console's project settings page.

    The "app id" should be the one formatted like 1:xxxxx:android:xxxxabc....

    Firebase console's project settings page

    Do not forget to upload the symbols for both Android and iOS apps, respectively replacing their APP_IDs.

    Moreover, keep always your deobfuscation symbols organized by build number. If not, "you'll do nothing" uploading the symbols from a build expecting to deobfuscate other build's Crashlytics logs.

    The Firebase crashlytics logs always show which build id that's related for. Example:

    Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown Instance of 'CD'.
    BuildId: tyb30glke21t763gs87gbbz9dvvs69869vs6
    

    When you upload the symbols, the build id appears in the debug logs so you can check it is being uploading for the right build.