Building .APK

Last Updated: 06/12/2020


NOTE: This "Legacy" section is old and is now meant for Advanced Developers who want to export using the Cordova CLI.
For most users, "Firebase Auth Pro Mobile" Plugin is recommended.


Debug .APK

1. Build debug APK:

After adding all plugins to your project, run this command to build a debug apk:

cordova build

This process will take more time on the first run. After successful build, you will get the file location of your built debug apk.


2. Get SHA Certificate Fingerprints for Debug .APK ( only for Phone Authentication):

If you are using Phone Auth-Cordova in your project, SHA Certificate is required.

Locate your java bin directory and run Terminal at this location. It is usually located at C:\Program Files\Java\jdk1.8.0_211\bin

For Windows Users, locate debug.keystore location. It should be located at C:\Users\user_name\.android

If you are a Mac user, don't worry about the location.

For Windows users, run this command:

keytool -list -v -keystore "<YOUR_DEBUG_KEYSTORE_LOCATION>" -alias androiddebugkey -storepass android -keypass android

For Mac users, run this command:

keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android


Signed .APK

1. Create a KeyStore:

If you don't have a keystore or want to create a new one, create it from Construct 3 Android Export, as given in the images.

Note down the SHA-1 signature. This will be required for Phone Authentication.

Download keystore.jks


2. Prepare files for Signing:

Create a "release-signing.properties" file.

Set the following text:

storeFile=/keystore.jks

storeType=jks

keyAlias=<YOUR_ALIAS>

keyPassword=<YOUR_KEYSTORE_PASSWORD>

storePassword=<YOUR_KEYSTORE_PASSWORD>

Go to YOUR_CORDOVA_APP_LOCATION\platforms\android

Paste keystore.jks and release-signing.properties at this location.


4. Build Signed .APK:

Run this command to build a signed release apk. After successful build, you will get the file location of your built debug apk.

cordova build android --release