Building the Android App
If you are building the release build, a pre-built version of these dependencies will be downloaded as part of the build. To do the release build, simply run
In this doc we'll focus on doing the debug build for developers.
Clone the three projects in the same directory.
git clone https://gitlab.com/bitcoinunlimited/libbitcoincashkotlin.git git clone https://gitlab.com/bitcoinunlimited/votepeer-library git clone https://gitlab.com/bitcoinunlimited/votepeer-android-app.git
The relative path to each project is configured in
Configure your SDK path by creating a file named
local.properties in the Android app project root. It should look similar to this:
## This file must *NOT* be checked into Version Control Systems, # as it contains information specific to your local configuration. # # Location of the SDK. This is only used by Gradle. # For customization when using a Version Control System, please read the # header note. #Fri Mar 26 15:37:10 CET 2021 sdk.dir=/Users/<user>/Library/Android/sdk
If you wish to add support for anonymous voting, you'll need to build with ring signature support. This requires more dependencies, see build guide for
libbitcoincashkotlin for details. Add the following to enable ring signature support:
If the build system is not finding your cmake installation, you can also explicitly add it to this file. Example:
With INTELLIJ/Android studio
If you prefer to attempt the above within Android Studio, here is how to:
File -> Project form version control, type in
Make sure Project SDk is added user project.
File-> Project structure -> Project settings -> Project
Make sure the latest Android SDK is selected under Project SDK
Setup up Firebase
Follow this tutorial to setup a firebase project and retrieve a google-services.json file
add google-service.json file to:
This project uses ktlint linter and code formatter. If using Android Studio, to make Intellij IDEA's built-in formatter produce ktlint-compatible code, run this once:
Android studio and cache
Android Studio is known for bad cache invalidation behavior causing build trouble. If you changed any of the settings above and get build issues, try removing its the cache.
File -> Invalidate caches... -> Invalidate cashes and restart
Building the project
From console, run
From android studio, in
Run/Debug Configuration, add a
Gradle task, set
build as task.
||Run linter and report errors|
||Run linter and attempt to fix errors|
||Run unit tests|