README.android.md 1.93 KB
Newer Older
Sharaf Zaman's avatar
Sharaf Zaman committed
1 2 3
# Building Krita for Android

First of all, I use linux to do my builds and testing. Although,
Wolthera van Hövell's avatar
Wolthera van Hövell committed
4
they _should_ work on Windows/macOS, I cannot give any guarantee 
Sharaf Zaman's avatar
Sharaf Zaman committed
5 6 7 8
that it will.

## Setting up Android SDK and NDK

Wolthera van Hövell's avatar
Wolthera van Hövell committed
9
We right now use Android NDK version `r18b` to do our builds. So,
Sharaf Zaman's avatar
Sharaf Zaman committed
10 11 12 13
I would recommend to use that. Download it from [google's website](https://developer.android.com/ndk/downloads/older_releases.html)
then extract it.

Next, Android SDK. You can either download Android Studio or just
Boudewijn Rempt's avatar
Boudewijn Rempt committed
14
the `sdk-tools`. Both could be downloaded from [google's website](https://developer.android.com/studio).
Sharaf Zaman's avatar
Sharaf Zaman committed
15

Wolthera van Hövell's avatar
Wolthera van Hövell committed
16
If you downloaded Android Studio then open SDK manager and download
Sharaf Zaman's avatar
Sharaf Zaman committed
17 18 19 20 21 22 23 24 25 26
`Android SDK Build-Tools`.
(more info: https://developer.android.com/studio/intro/update#sdk-manager)

If you download just `sdk-tools`, then, extract it and run:

```shell
cd <extracted-android-sdk-tools>/tools/bin
./sdkmanager --licenses
./sdkmanager platform-tools
./sdkmanager "platforms;android-21"
Sharaf Zaman's avatar
Sharaf Zaman committed
27
./sdkmanager "platforms;android-28"    # for androiddeployqt
Sharaf Zaman's avatar
Sharaf Zaman committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
./sdkmanager "build-tools;28.0.2"
```

If you get some `ClasNotFoundException` it might be because `java`
version is set to `11`. For `sdkmanager` to work, set it to `8` and
then run it again.

That's the only dependency we have to manage manually!

## Building Krita

Now, to build krita, run `<krita-source>/packaging/android/androidbuild.sh --help`
and pass the required arguments.

Example:

```shell
./androidbuild.sh -p=all --src=/home/sh_zam/workspace/krita --build-type=Debug --build-root=/home/sh_zam/workspace/build-krita-android --ndk-path=/home/sh_zam/Android/Sdk/ndk-bundle --sdk-path=/home/sh_zam/Android/Sdk --api-level=21 --android-abi=armeabi-v7a
```

That's all!

## Installing Krita APK

To install run `adb install -d -r <build-root>/krita_build_apk/build/outputs/apk/debug/krita_build_apk-debug.apk`.

`adb` should be in `<sdk-root>/platform-tools/`

## Crash

If Krita crashes you can look up the logs using `adb logcat`