QtCreator 5.4.1 and Android

To use the Android Build Kit with QtCreator it is necessary to download a series of packs from the web:

Android SDK  http://developer.android.com/sdk/index.html#Other
Android NDK  http://developer.android.com/tools/sdk/ndk/index.html
Apache Ant  http://ant.apache.org/bindownload.cgi
Oracle JDK  http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Screen Shot 2015-03-26 at 2.24.16 PM

Once you have downloaded and installed, go to QtCreator preferences and configure the paths to each component.


 

Mac Users:
Attention to the NDK file which comes in bin format. In this case use:
chmod +x [path]/android-ndk-r10c-darwin-x86_64.bin
then
[path]/android-ndk-r10c-darwin-x86_64.bin


Android APK sign/align for Google Play
(The following tools should be available in the Android SDK)

Create Key (Keep it in safe place, you will need it to submit updates)

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

Sign the app with your key

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore
my_application.apk alias_name

If you receive this error: jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry compressed size. Qt could have already signed your package “somehow”. In this case, you will need to unsign the APK before signing it with your key.

zip -d foo.apk META-INF/\*

Zip align the app

 zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk (zipalign is in build-tools)