Create a key and sign a build of your app

The first thing you’ll need to do, is be able to create a signed APK.

This differs strongly from iOS, where Apple serves as a signing authority. Though Android has recently enabled this service to mimic Apple, I still find creating your own key easiest.

Fortunately, all the steps to generate a key and use it to sign your Android app are extremely well-documented by Facebook. I would be remiss to re-write the docs provided by React Native here. Perform the steps specified and I’ll catch back up when you’re done.

🗝🔒 — Store your keystore file, password, and alias in your secrets repo from step 1, so people other than you can deploy the app if you go on vacation.

Be sure to add the keystore to your .gitignore so it is never checked into version control. Once you publish with this keystore, you can’t lose it without losing the ability to update your app in the Play Store, so keep it safe!

If your release builds just fine, congratulations! Skip down to step 3. If not, I often see two problems. Here are my fixes:

If your release build fails due to an “multiDex” problem, you simply need to ./gradlew clean and you should be good. Every so often you might be held back by something as silly as linting errors.

LINTING ERRORS!?!

Isn’t the idea of React Native that I don’t have to muck around in Android syntax unless I WANT to? Fortunately, the output provides a “solution” to remove linting errors. Add the following under buildToolsVersion line in your ./android/app/build.gradle file.

// Android gonna droid

lintOptions {

abortOnError false

}

This works great, unless you’ve brought in a third-party lib that ALSO has linting issues. Now you’ve got to run around and add this to every build.gradle , even the third-party libraries in node_modules which fail to lint properly.

A better solution is to turn linting off for everybody. Add this to the bottom of your ./android/build.gradle and all your dependent projects will avoid linting as well.