Fabric/Crashlytics beta deploy from Bitrise
Asked Answered
L

3

5

I have configured a build for an Android project in Bitrise. Now I need to setup automatic deployment for beta testing in Fabric/Crashlytics, just don´t know how to add a step to accomplish that. Any ideas?

Lely answered 20/8, 2016 at 23:22 Comment(0)
V
5

The same way you would on your Mac/PC.

You have to configure your project for Fabric/Crashlytics, following their official guides. At the end of the setup (current guide link: https://fabric.io/kits/android/crashlytics/install) you'll have Fabric/Crashlytics integrated into your Gradle project.

After the setup, to deploy to Fabric/Crashlytics, just run any of the Gradle tasks which invoke the Fabric/Crashlytics deploy.

On bitrise.io / with bitrise CLI you can run the Gradle task e.g. with the Gradle Runner step (or with a Script step).

Valona answered 20/8, 2016 at 23:37 Comment(2)
If in a previous workflow step I'm signing the unsigned APK with a Keystore, how can I tell this new gradle task to select that new signed APK for running the Fabric deployment? I'm always getting an error about "Crashlytics halted compilation because it can't distribute the unsigned APK: /bitrise/src/Application/build/outputs/apk/Application-release-unsigned.apk"Threatt
"If in a previous workflow step I'm signing the unsigned APK" - if you follow their guide then you should run the related Gradle task, not just specifying a previously generated .apk (AFAIK). The Crashlytics specific gradle task should take care of the Crashlytics related/required signing (AFAIK a simple debug signing).Valona
L
2

Thanks to @Viktor's answer I managed to figure out the exact steps to autmatically upload the apk to Crashlytics-Beta from Bitrise. Here are the details.

  1. Click your build definition, then Workflows tab and finally Manage Workflows button.
  2. Add a new environment variable, for that click the green "Manage env. vars" button, add a new environment variable named "GRADLE_TASK_RELEASE" or whatever name suits you, then set its value to "assembleRelease crashlyticsUploadDistributionRelease" and close the environment variables window.
  3. Select the Gradle Runner step to edit it. Inside the section "Gradle task to run", change the value and put the recently created variable "$GRADLE_TASK_RELEASE", save the changes and you will be good to go.

At the end of the step in the log something like the following:

Uploading /bitrise/src/YOUR_PROJECT/build/outputs/apk/YOUR_PROJECT-release.apk to Crashlytics...
Lely answered 25/8, 2016 at 13:56 Comment(0)
A
1

Just add assembleRelease crashlyticsUploadDistributionRelease to your gradle task.

Astraddle answered 15/12, 2016 at 16:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.