loading...

Deploying your app with Bitrise

aniketsmk profile image Aniket Kadam ・2 min read

I had a pretty hard time deploying an app via bitrise to the play store and I ran into several errors because I had a few wrong assumptions and some things in the docs were unclear.
So I'll walk through what surprised me.

The first and greatest surprise, was that by default, bitrise doesn't do the steps you need before you can even begin to deploy such as....making a build!

So first we'll need to add some steps to the workflow.

Steps you'll need to add to the workflow:

  1. Android Build!
    Yes, bitrise doesn't actually do a release build on its own. It'll just do the test build!

  2. Android Sign
    Since it doesn't do a build, and it doesn't have your keys or info, there's no way it can sign right!
    That's the next step, where you upload your keystore and give it the passwords.

  3. Deploy to Google Play
    This means you'll have to a lot, creating a worker, giving it access and getting a key in json form. This can be done via following the link here
    The mistake I made, was putting the json directly into a secret variable. Which gets you a very confusing error.
    What you need to do is go to code signing and add your JSON key to a generic file storage.
    There you specify an environment variable for it and give it the entire json file.

  4. Specify an aab build. This makes the app smaller for each person who downloads it since files that aren't supported on their phone (such as language files or binary blobs specific to architectures) aren't downloaded.

  5. Remember to update the version code for sure otherwise it'll just be rejected saying that the version was the same as another build.

That's it, you should now be able to deploy directly to the play store. It could help if you always deploy to alpha or beta and if you're feeling brave, even production.
I wouldn't do a production deploy unless you had UI tests that ran on either the Firebase Test Lab or an emulator at least.
It's too easy to just instantly crash all your users even with flawless unit testing.

Discussion

pic
Editor guide