-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[Android] How to build project
Aleksandr Zatsepin edited this page Sep 11, 2020
·
20 revisions
The project may be built without problems only on Mac or Linux platform. Windows OS is no longer supported.
First of all, you have to install these required components:
Android SDK, NDK (now, it's r21d (ndkVersion = "21.3.6528147") 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:
- Clone or download MapsMe code from the current repo.
- 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 through Android Studio: File->Project Structure->SDK Location or put their in the local.properties file directly. An example of local properties file:
ndk.dir=/Users/<username>/Library/Android/sdk/ndk/21.3.6528147
sdk.dir=/Users/<username>/Library/Android/sdk
- Execute the script omim/configure.sh and follow the prompts.
- Execute two commands:
git submodule init
git submodule update
- 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 assembleWebDebug
(or./gradlew aWD
- is the short form). Also you can provide optional parameters:-Parm32
(build only for ARM32(armeabi-v7a) arch),-Parm64
(build only for ARM64(arm64-v8a) arch),-Px86
(build only for x86 arch) and-Px86_64
(build only for x86_64). - 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!