# How to expose the apk uploaded to crashlytics generated by fastlane

**URL:** <https://discuss.bitrise.io/t/how-to-expose-the-apk-uploaded-to-crashlytics-generated-by-fastlane/4614>\
**Category:** Question & Answer\
**Tags:** fastlane, android, crashlytics\
**Created:** [March 27, 2018, 1:25am UTC](https://discuss.bitrise.io/t/how-to-expose-the-apk-uploaded-to-crashlytics-generated-by-fastlane/4614 "2018-03-27T01:25:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiao-nirovision](https://avatars.discourse-cdn.com/v4/letter/x/57b2e6/32.png) [@xiao-nirovision](https://discuss.bitrise.io/u/xiao-nirovision)\
**Post date:** [March 27, 2018, 1:25am UTC](https://discuss.bitrise.io/t/how-to-expose-the-apk-uploaded-to-crashlytics-generated-by-fastlane/4614/1 "2018-03-27T01:25:58Z")

</div>

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
  crashlytics(
    api_token: "adsfasdfasdfhasghjklfashgjkhdafjkghjkaghjkahsg",
    build_secret: "ajsdklfjklasdfjklasdjflkasdjklfjaslkdjflkasdjfkljaslkdfjklsdajfklsadjflkadsj"
  )
end

```

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 [bitrise.io](http://bitrise.io)” doesn’t upload any apk to it.

I assume that the “Deploy to [bitrise.io](http://bitrise.io)” 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?

 ![image](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/a/a30970e82f2066b4f9d3a29b558bb4a8501e8504.png)

Thanks a lot

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [March 27, 2018, 5:40pm UTC](https://discuss.bitrise.io/t/how-to-expose-the-apk-uploaded-to-crashlytics-generated-by-fastlane/4614/2 "2018-03-27T17:40:50Z")

</div>

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 [Bitrise.io](http://Bitrise.io)** 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 [Bitrise.io](http://Bitrise.io)** step to the path where you store the APK (e.g. something like `$BITRISE_SOURCE_DIR/build/.../app.apk`

Related docs: [https://devcenter.bitrise.io/tips-and-tricks/attach-any-file-to-build/](https://devcenter.bitrise.io/tips-and-tricks/attach-any-file-to-build/)

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

P.S.: on the screenshot you linked I saw that you already change the “Deploy directory of file path” option of the **Deploy to [Bitrise.io](http://Bitrise.io)** 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.

---

<div class="post-metadata">

**Author:** ![xiao-nirovision](https://avatars.discourse-cdn.com/v4/letter/x/57b2e6/32.png) [@xiao-nirovision](https://discuss.bitrise.io/u/xiao-nirovision)\
**Post date:** [March 27, 2018, 11:16pm UTC](https://discuss.bitrise.io/t/how-to-expose-the-apk-uploaded-to-crashlytics-generated-by-fastlane/4614/3 "2018-03-27T23:16:40Z")

</div>

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

Xiao

---

<div class="post-metadata">

**Author:** ![xiao-nirovision](https://avatars.discourse-cdn.com/v4/letter/x/57b2e6/32.png) [@xiao-nirovision](https://discuss.bitrise.io/u/xiao-nirovision)\
**Post date:** [March 28, 2018, 12:26am UTC](https://discuss.bitrise.io/t/how-to-expose-the-apk-uploaded-to-crashlytics-generated-by-fastlane/4614/4 "2018-03-28T00:26:36Z")

</div>

> [@viktorbenei](#):
>
> ENV[‘BITRISE\_DEPLOY\_DIR’]

Cool, it works. Thanks @viktorbenei

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [March 28, 2018, 3:57pm UTC](https://discuss.bitrise.io/t/how-to-expose-the-apk-uploaded-to-crashlytics-generated-by-fastlane/4614/5 "2018-03-28T15:57:03Z")

</div>

Glad to hear! 😉 Happy Building!
