Export to Cordova Project

Setting you project information like picture below:

On Construct 3

Cick file on the left top corner then click export and then select Cordova then click next.

Check Hide status bar , and select minimum Android is 5.0+ (Lollipop / API Level 21) then click export.

On Construct 3

Download your Cordova Project:

Then extract the exported files Cordova Project to your_username\Your_Project

Open terminal then change directory to your Cordova project (on picture above example I use Your_Project for folder name), type:

cd Your_Project

Edit config.xml, on terminal type:

nano config.xml

and replace:

<preference name="android-targetSdkVersion" value="26" />

to

<preference name="android-targetSdkVersion" value="28" />

And then save (control x then enter for overwrite file) and now open config.json, on terminal type:

nano config,json

Then change:

"target": 26,

to

"target": 28,

Save and overwrite config.json (control x then enter), on terminal type:

cordova prepare


Build Debug APK

If you want build debug apk then type on terminal:

cordova build android

and the result on screenshot below. You can find the debug apk inside your project folder:

Your_Username\Your_Project\platform\android\app\build\outputs\apk\debug


Build Release APK

On command prompt type:

cordova build –release android

and the result should like picture below:

The release apk file is unsigned, before you can upload it to Google Play Store we need to signing the release apk. You will need a keystore for signing process and now we create a keystore.


Create a Keystore

Go to release apk folder via terminal type:

cd platforms\android\app\build\outputs\apk\release\

then press enter and type:

keytool -genkey -keystore Your_Keystore_Name.keystore -alias Your_Alias_App -keyalg RSA -keysize 2048 -validity 9999 -v

You will asked create a password, create your password and remember it. Then after you fill all the questions and keytool will asking about all your input data is correct? Then type yes, see picture below.

You can find your keystore on the same folder with release apk.


Signing APK

And the last step we use jarsigner for signing the release apk. Make sure your command prompt on release directory then type:

jarsigner -sigalg SHA1withRSA -digestalg SHA1 -verbose -keystore Your_Keystore_Name.keystore app-release-unsigned.apk Your_Alias_App

then enter your password, the final result should like picture below:

Final result should like screenshot below:

Now your APK is ready to upload to Play Store and remember always keep your keystore and do not lose the password. Thank you for reading.


Creative Commons LicenseThis article is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.