Nice! If I might suggest some improvements:
- This article is not limited to React Native. In fact, this is the exact method of how to sign standard Android APKs.
- The code could be more readable in the signing config section — adding temporary values like ‘ANDROID_STORE_FILE_NOT_SET’ seems to defeat the purpose. I get it why you use
property— otherwise the Gradle sync would fail by default.
I would improve it by leveraging the fact that
findProperty returns null. More importantly, I would fail the build when the signing config is missing by throwing a
GradleException , because missing secrets should result in a build failure. You can find out how in this Gist. Hope this can improve your build process!
One more thing: Is your build time 8 minutes by default? If most of the time is spent on installing the Android SDK and downloading dependencies, you can improve your build time a lot by using this Docker image and activating a Gradle cache. I got it down to 2 minutes (including unit tests).