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â doesnât upload any apk to it.
I assume that the âDeploy to 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?
Thanks a lot
Hi @xiao-nirovision,
There are two ways:
- Either move the APK into the
$BITRISE_DEPLOY_DIR
, which is the default dir deployed by Deploy to 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.
- Or change the path which should be deployed in the Deploy to 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/
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 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
Xiao
1 Like
Cool, it works. Thanks @viktorbenei
1 Like
Glad to hear! Happy Building!