How to compile manually Android apps?

To generate the APKs

If you are using the Siberian SAE you have to manually generate the APKs. You can check this article to see how to compile the APKs manually. If you are using a commercial edition (MAE or PE) you can generate the APKs automatically. If you don’t have already installed the APK Generator please click here to see how to install it, at the bottom of the article).
If you don’t have installed the APK Generator, to manually generate the APK, follow these steps to generate it from the source files:

First of all you need Android Studio to generate the APK. If you haven’t already you will have to download and install it:

If your Siberian is on version 4.0 at least (Ionic design), you need the Android Studio version 3+ (you can download it here). Follow the following process below to set up your Android Studio. (You can check the version of your Siberian at the bottom of your backoffice)

If your Siberian is on version below 4.0 (3.17.1 or lower), you have to use Android Studio in version 0.8.14. Click here to see how to download Android Studio in this version and set it up. (You can check the version of your Siberian at the bottom of your backoffice)

Setting up Android Studio for apps in Siberian version 4.0+

Download the 3+ version of Android Studio: click here

Then install Android Studio. Please note that you can have both the 0.8.14 version (if you want to keep building apps for Siberian version below 4.0), you just have to install this new Android Studio in another folder of your computer than the one you already use for the 0.8.14 version).

Choose Standard:

Screen Shot 2016-03-25 at 17.50.36

Select this setting (“I do not have a previous version of Studio or I do not want to import my settings”):

Screen Shot 2016-03-25 at 17.48.36

You are good. Now click here to see how to compile the app using Android Studio.

Setting up Android Studio for apps in Siberian version below 4.0

Go to http://tools.android.com/download/studio/canary/0-8-14 and then download the Android Studio v0.8.14 related to your OS, and install it.

Then, go here https://developer.android.com/sdk/index.html and at the bottom of the page, in the “SDK Tools only” section download and install the SDK related to your OS.

Then, open Android Studio you’ve just installed, and click on “Configure”:

Screen Shot 2014-10-12 at 12.08.56

Then, click on SDK Manager:

Screen Shot 2014-10-12 at 12.09.05

 

You will see a list of packages, some are installed some are not. There are some items that are checkked and some that are not. In addition to the ones that are already checked, be sure these ones are too, if not, check them:

  • In Tools:
    • Android SDK Build-Tools 19.1
    • Android SDK Build-Tools 20
    • Android SDK Build-Tools 21.1.2
  • In Android 4.4W.2 (API 20):
    • SDK Platform
  • In Android 4.4.2 (API 19):
    • SDK Platform
    • ARM EABI V7a System Image
    • Google APIs (ARM System Image)
  • In Extra:
    • Android Support Repository
    • Android Support Library
    • Google Play services
    • Google Play Repository

Then click on the “install X packages” button:

Capture d’écran 2015-08-28 à 15.29.20

 

Then, click on every license and choose “Accept License”, and then Install:

Screen Shot 2014-10-12 at 12.10.52 Screen Shot 2014-10-12 at 12.11.41
Once all the packages installed, you should have something like that:

Capture d’écran 2015-08-28 à 15.32.29

Capture d’écran 2015-08-28 à 15.32.46
Voila, your Android Studio is ready to create the APKs.

How to create an APK

Note: don’t forget that you have to filled out the Android Push keys for your backoffice prior to create your APK if you want to be able to send push notifications. Here is our article about Android push notifications.

From your backoffice, in Manage > Application(s), enter in the app page, go down in the page to “Mobile Source Codes & Builds” and download the Android Source files by clicking on “Android Version”:

Unzip this file.

Then go back to the main menu of Android Studio:


Click on “Import project”.

Then choose the Android Source folder you have unzipped, and click on “import”.

When your project is imported, from the left menu, click on Project  and select Project in the list to display your folder “android_source” and open the tree.

From the main menu click on Build > Generate Signed APK.

Then, click next and you get this screen:

Depending if it’s an update of an app already published, or a new app choose:
– “Create new”, if it’s a new app
– “Choose exiting”, if it’s an update of an app already published

(In this tuto, we are going to see the first case, but second case is almost the same.)

Okay, so you have chosen “Create new”. Now we suppose that you are someone very organized (if not already, take a look to the article about iOS publication and organize your folders the same way), and thus that you have already create a folder for your app publication on your computer. Before having downloaded the android sources file, you have created a folder on your computer named “My Awesome App”, for instance, with two subfolders: one for the graphic items, like screenshots of this app, and one for the certificates which will be named “certificate”. Thus, on your computer we have a folder named “My Awesome App” with the subfolder “certificate” and the other subfolder “graphics”.

Okay now let’s go back to Android Studio. You have clicked on “Create new”, and you get this screen:

Now click on the button to browse in your computer folder and go to the “certificate” folder, in the main folder “My Awesome App”, and below in the “File name” field, enter “certificate”, and click ok:

Enter a password for the Key Store, enter an alias name (the name of the app is OK), and a password the Key Alias, set the validity period to 25 years, and enter the name of the app owner. Then click Ok:

In the summary screen click Next :


Then in the next screen, choose “release” for “Build Type” and then click on Finish.

The generation of your APK will begin.

NOTE:

From Android Studio 2.0 you can encounter the error “Error:’com.android.build.gradle.BasePlugin’ does not implement the Plugin interface.”. To fix this problem, just go in the menu of Android Studio in Preferences > Build, Execution, Deployment > Gradle, and then check the option “Use default gradle wrapper” like in the image below:

Was this article helpful?

Related Articles