Skip to content

[Android] How to build project

Aleksandr Zatsepin edited this page Dec 14, 2017 · 20 revisions

First of all, you have to install these required components:

Android SDK, NDK (now, it's 13b version, but the new one should work as well), CMake (only from android sdk manager, because android uses its own/custom Cmake implementation), LLDB (if you want to be able to debug native code).

After all required components are installed do these steps:

  1. Clone or download MapsMe code from the current repo.
  2. Execute the script omim/tools/android/set_up_android.py . This script creates the local.properties file for you where sdk/ndk paths are specified. But, you can provide the mentioned paths manually, throught Android Studio: File->Project Structure->SDK Location.
  3. Execute the script omim/configure.sh and follow the prompts.
  4. Execute consequently two commands: git submodule init git submodule update
  5. To build project you have to use gradle wrapper. Wrapper downloads all needed dependencies for you. Project has a lot of configurations which you can see in build.gradle file. For example to buil Web Debug version of app you should do following command staying in omim/android folder:
    ./gradlew assemplWebDebug (or ./gradlew aWD - is the short form). Also you can provide optional parameters: -Parm(build only for ARM arch), -Px86(build only for x86 arch).
  6. If building is completed without errors the apk file will be found in omim/android/build/outputs/apk folder, if errors are encountered please let me know!
Clone this wiki locally