How to upload a mapping.txt file to Crashlytics using firebase-cli?

75 Views Asked by At

I don't want to use non-free firebase gradle-plugin in my Android-project.

How to upload mapping.txt using firebase-cli?

I tried to execute this command:

firebase crashlytics:mappingfile:upload --app=[MY_APP_ID] \
    --resource-file=app/src/main/res/values/crashlytics.xml \
    mapping.txt

It gives me:

i  Uploading mapping file: mapping.txt
⚠  An unknown error occurred

Error: java command failed with args: -jar,/home/[...]/.cache/firebase/crashlytics/buildtools/crashlytics-buildtools-2.9.2.jar,-uploadMappingFile,mapping.txt,-resourceFile,/home/[...]/app/src/main/res/values/crashlytics.xml,-googleAppId,[MY_APP_ID],-verbose,-clientName,firebase-cli;crashlytics-buildtools

Having trouble? Try firebase [command] --help

If I add --debug flag I get almost the same output:

[2024-03-01T21:29:01.961Z] Buildtools Jar already downloaded at /home/[...]/.cache/firebase/crashlytics/buildtools/crashlytics-buildtools-2.9.2.jar
i  Uploading mapping file: mapping.txt 

Error: java command failed with args: -jar,/home/[...]/.cache/firebase/crashlytics/buildtools/crashlytics-buildtools-2.9.2.jar,-uploadMappingFile,mapping.txt,-resourceFile,/home/[...]/app/src/main/res/values/crashlytics.xml,-googleAppId,[MY_APP_ID],-verbose,-clientName,firebase-cli;crashlytics-buildtools

Having trouble? Try firebase [command] --help

Previously I've installed firebase-cli on my remote server using this command:

curl -sL https://firebase.tools | bash

And made all necessary steps after typing:

firebase login

Is there an option to find out the cause of the error?

Running another command crashlytics:mappingfile:generateid gives me the same error message.

1

There are 1 best solutions below

0
Vadik Sirekanyan On

Firebase-cli uses java under the hood, check if java installed on your machine:

java -version

If this command fails, install java and try to run your commands again.