Building Android apps

Setting up an Android app on Nevercode

This tutorial guides you through setting up your Android app on Nevercode. Nevercode doesn't require any kind of additional software or configuration files from your side. We’ll scan your repository and from what you have there, our builders find everything they need. You’ll just have to confirm what configuration you want to build.

This guide covers how to:

Add a new app

  1. Click Add a new app on Nevercode dashboard.

Nevercode dashboard

  1. Select the appropriate option for where your app repository is hosted. See Specifying app repository for details. If you choose to add the repository manually, see Defining checkout URL and Authenticating repository access for details.

Define build configuration

After specifying app repository, Nevercode takes a first look at it by listing the branches in this repository. The next step for you is to select the branch you want Nevercode to scan for projects.

  1. Select a branch from the dropdown that Nevercode should scan. Note that you can change the branch later if needed.
  2. Click Scan branch. Nevercode scans the repository from the specified branch. This includes cloning the repository, looking for projects from it and searching for the configurations. All these actions can be monitored real-time from your browser via the live log window.
  3. Once scanning the branch has finished, select a project in the Project dropdown.
    The Project is an Android app directory in your repository or the repository root. Project, in a sense, is a container for one or more app flavors. Usually, there is only one project in the repository, but there might be more, for example when you have a library project and a sample app that uses this library.
  4. Select a gradle task that will be used to build your app in the Task dropdown.
    The easiest choice there is to pick the assemble task which builds every possible configuration of your app at once. If you have some specific flavor you want to be built, say ExampleFlavor, then just select assembleExampleflavor and you're ready to go.

Build configuration

  1. Enable the appropriate build options by checking the corresponding boxes.
  2. Finally, click the Save and start build button. Nevercode will start the very first build of your app and you can monitor the real-time logs right in your browser.

Build Android app bundle

You can build your app in Android app bundle (.aab) format by selecting a gradle task which compiles an Android bundle (e.g. bundleDebug or bundleRelease) in build configuration. Nevercode will then build an .aab file along with a universal .apk. If you set up publishing to Google Play, the .aab file will be published by default.

Note that in order to upload your Android app bundle to Google Play, you will need to:

  1. Build the app in release mode.
  2. Set up Android code signing in Nevercode to sign the app bundle.
  3. Set up publishing to Google Play in Nevercode to upload your app bundle to one of Google Play tracks.
  4. Enroll your app into app signing by Google Play to have Google sign the APKs that are generated from the app bundle during installation.

When you enroll an app into app signing by Google Play, Google will manage your app’s signing key for you and use it to sign the APKs for distribution. Note that the app must be signed with the same key throughout its lifecycle, so if the app has already been uploaded to Google Play, make sure to export and upload your original key to Google Play for app signing. It is then recommended to create a new key (“upload key”) for signing your app updates and uploading them to Google Play.

Sign code

The very first version of your app on Nevercode is built without code signing. See how to sign your Android binaries on Nevercode.

Set up Git hooks

By setting up Git hooks, you can have Nevercode automatically build your app every time you push changes to the repository. For instructions, please refer to Building automatically (Git hooks).

Run tests

Setting up testing in Nevercode is 100% automatic. When you submit your repository, we scan the selected configuration for tests. If there are any tests present and you have selected a configuration with build prefix, we'll run the tests for every build you make.

The test report screen in build overview shows you a simple overview of all passed and failed tests, including the failure reason, so you can quickly identify what's broken.

Read more about supported test frameworks and how to configure tests for Android on Nevercode.

Publish build artefacts

Nevercode supports publishing your Android applications to several distribution channels.

Manage build versions

To make your build version management easy, Nevercode exports two environment variables that you can use in your build scripts: NEVERCODE_BUILD and NEVERCODE_BUILD_NUMBER. You can read more about it from Incrementing Android app version.

Other configuration

See also how to:

Updated about a year ago

Building Android apps

Setting up an Android app on Nevercode

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.