Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayoubkhan558/74e05ceb8cba9171c40c86a90fa0ee0e to your computer and use it in GitHub Desktop.
Save ayoubkhan558/74e05ceb8cba9171c40c86a90fa0ee0e to your computer and use it in GitHub Desktop.
Generate Android Signed APK File for Google Play with Ionic
  1. Navigate to the project folder

  2. In the command line run ionic build android --release

  3. Then in the command line run jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore platforms/android/build/outputs/apk/android-release-unsigned.apk alias_name

    Change "my-release-key.keystore" and "alias_name" to match your app. You may also need to change the name of the apk file.

    Also, after the build process in step 2, you should see the path to your release apk at the bottom of the output.

  4. The zipalign -v 4 platforms/android/build/outputs/apk/android-release-unsigned.apk MyApp.apk

    You may need to change the name of the apk file. The signed apk will be in the main folder unless you specify a different folder.

Common Problems:

No Keystore

Run keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

Change "my-release.keystore" and "alias_name" to match your app and preferences.

Keep this file in a safe place. If you lose it you may be unable to upload revisions of your app to the store.

Errors - Permission Denied or EACCES problems

Run sudo ionic build android --release

Errors - Missing translations

In Platforms\Android add a file called lint.xml Add the following to that file:

<?xml version="1.0" encoding="UTF-8"?>
<lint>
    <issue
            id="MissingTranslation"
            severity="ignore" />
    <issue
            id="ExtraTranslation"
            severity="ignore" />
</lint>

Important! This file will be deleted if you remove the android platform. By default it is ignored by git.

Zipalign or Jarsigner are not available

Make sure you have the Android SDK installed.

Make sure that the location of the Android SDK is in your path. Alternatively, you can copy the zipalign and jarsigner executables from the Android SDK folder (wherever you chose to install it) to your project folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment