How to expose the apk uploaded to crashlytics generated by fastlane

Hi I recently imported an android project on bitrise and created a workflow for it

Since the project already has fastlane added.

My fastlane about building apk and uploading is like this

lane :crashlytics_stagingDebug do
  # build the release variant
  build_android_app(task: "assembleStagingDebug")

  # upload to Beta by Crashlytics
    api_token: "adsfasdfasdfhasghjklfashgjkhdafjkghjkaghjkahsg",
    build_secret: "ajsdklfjklasdfjklasdjflkasdjklfjaslkdjflkasdjfkljaslkdfjklsdajfklsadjflkadsj"

So in the workflow, I use fastlane to execute “assembleStagingDebug”. But it seems that the apk got directly uploaded to crashlytics. The following Step “Deploy to” doesn’t upload any apk to it.

I assume that the “Deploy to” doesn’t know that apk generated by fastlane. May I ask how should I configure the “Deploy to bitrise” to also attach the generated apk in bitrise?

Thanks a lot

Hi @xiao-nirovision,

There are two ways:

  1. Either move the APK into the $BITRISE_DEPLOY_DIR, which is the default dir deployed by Deploy to step . You can of course do this in your fastlane config too, moving or copying the APK, you can get the $BITRISE_DEPLOY_DIR environment variable’s value with ENV['BITRISE_DEPLOY_DIR'] in Ruby.
  2. Or change the path which should be deployed in the Deploy to step to the path where you store the APK (e.g. something like $BITRISE_SOURCE_DIR/build/.../app.apk

Related docs:

If you’d have any questions just let us know! :wink:

P.S.: on the screenshot you linked I saw that you already change the “Deploy directory of file path” option of the Deploy to step, so either set that to the right path (where the APK is stored) or change it back to the default $BITRISE_DEPLOY_DIR and go with the #1 point.

Hey @viktorbenei

Thanks so much for answering, I will try your first solution and let you know how it goes.

As for the second solution, the reason I kind of want to avoid using it is that I have different flavors with my app which will have different output folder.

But thanks so much anyway


1 Like

Cool, it works. Thanks @viktorbenei

1 Like

Glad to hear! :wink: Happy Building!