Generating the Android APK
Building the Android Application Package (APK) is a bit more cryptic than releasing for iOS. There are a few steps that we need to follow before we generate the static bundle, like we did in iOS:
First, we need to generate a key that we can use to sign our application using
keytool
. Navigate to theandroid/app
folder in a terminal and run this command:$ keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000 [Storing my-release-key.keystore]
Note
Note that this is a private file and should never be shared with anyone. Keep it somewhere safe!
Next we have a few configuration files to update. Up a level in the
android/ directory
opengradle.properties
and add these four lines, replacingYOUR_KEY_PASSWORD
with the password you used forkeytool
:MYAPP_RELEASE_STORE_FILE=my-release-key.keystore MYAPP_RELEASE_KEY_ALIAS=my-key-alias MYAPP_RELEASE_STORE_PASSWORD=YOUR_KEY_PASSWORD MYAPP_RELEASE_KEY_PASSWORD= YOUR_KEY_PASSWORD...