We need to follow the steps below to create .apk with gradle build system:
As part of the steps, I assume that I am creating a project "MyApp"
Step 1: generate the myapp.keystore file using the following command:
keytool -genkey -v -keystore myapp.keystore -alias myapp -keyalg RSA -keysize 2048 -validity 10000
Step 2: create an ant.properties file with the following data:
storeFile=myapp.keystore storePassword=<<your keystore password>> keyAlias=myapp keyPassword=<<your keystore password>>
Step 3: create the gradle.properties file with the path to the ant.properties file:
cdvReleaseSigningPropertiesFile= <<path to ant.properties>>
Step 4: use the last command as follows:
ionic build android --release
Note. You must set the path for: java, adb, jarsigner, zipalign
Your generated apk will be in the build folder.
Nirav shah
source share