How to build Kodi Krypton for Android with no compiler errors.
This is based on xbmc/docs/README.android. I just filled in
the blanks that README.android had. The APK was tested on
Amazon FireTV.
After many hours of trying to compile Kodi for Android, I thought I could
share my steps to help prevent headaches. This is a step by step guide.
This will work with both Windows 7, and OSX (because we are using Virtual box.)
There are less things to go wrong when you start with a fresh install of the
operating system.
———————————————–
Starting Environment:
Ubuntu 16.04 LTS 64 bit(running on Windows 7 Virtual Box 5.1.14)
javac 1.8.0_121
openjdk version “1.8.0_121”
OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
———————————————–
** Here are the steps:
———————-
1) Install VirtualBox, then make a Linux Virtual Machine
———————-
VirtualBox on Windows 7 host. A 30GB expandable disk for Linux is plenty.
Ubuntu 16.04 LTS 64 bit(running on Windows 7 Virtual Box)
———————-
2) Prepare the Ubuntu installation:
———————-
$ sudo apt-get update
$ sudo apt-get install default-jdk
$ sudo apt-get install build-essential default-jdk git curl autoconf \
unzip zip zlib1g-dev gawk gperf cmake
$ sudo apt-get install lib32stdc++6 lib32z1 lib32z1-dev
$ sudo apt-get install libcurl4-openssl-dev
———————-
3) Get Android SDK & NDK
———————-
a) SDK tools
$ mkdir $HOME/android-sdk-linux
get the sdk tools from the link below:
https://dl.google.com/android/repository…-linux.zip
uncompress tools_r25.2.3-linux.zip to: /$HOME/android-sdk-linux/
$ cd /$HOME/android-sdk-linux/tools
$ ./android update sdk -u -t platform,platform-tool
$ ./android update sdk –all -u -t build-tools-20.0.0
b) NDK
get the NDK from the link below
https://dl.google.com/android/repository…x86_64.zip
uncompress android-ndk-r12b-linux-x86_64.zip to /$HOME/
so you’ll have: /$HOME/android-ndk-r12b
———————-
4) Set up the Android tool chain
———————-
$ cd /$HOME/android-ndk-r12b
$ cd build/tools
$ ./make-standalone-toolchain.sh –ndk-dir=../../ \
–install-dir=/$HOME/arm-linux-androideabi-4.9-vanilla/android-21 –platform=android-21 \
–toolchain=arm-linux-androideabi-4.9
———————-
5) Creat debug key to sign for the APK
———————-
$ keytool -genkey -keystore ~/.android/debug.keystore -v -alias \
androiddebugkey -dname “CN=Android Debug,O=Android,C=US” -keypass \
android -storepass android -keyalg RSA -keysize 2048 -validity 10000
———————-
6) Get the source code — this gets me Kodi version 17 RC1
VERSION_MAJOR 17 / VERSION_MINOR 1 / VERSION_TAG RC1
VERSION_CODE 170901 / ADDON_API 17.0.901
———————-
$ cd $HOME
$ git clone -b Krypton git://github.com/xbmc/xbmc.git kodi-krypton
$ cd kodi-krypton
———————-
8) Building dependencies
———————-
$ cd $HOME/kodi-krypton/tools/depends
$ ./bootstrap
$ ./configure –with-tarballs=/$HOME/xbmc-tarballs –host=arm-linux-androideabi –with-sdk-path=/$HOME/android-sdk-linux –with-ndk=/$HOME/android-ndk-r12b –with-toolchain=/$HOME/arm-linux-androideabi-4.9-vanilla/android-21 –prefix=/$HOME/xbmc-depends
— this next two steps would take a while. I did not follow the advice to use make -j
$ make
$ make -C target/binary-addons
———————-
9) Building Kodi.Finally!!!! The instructions in the readme.Android are not updated.
The two lines with * are completely different than the README file.
———————-
$ cd $HOME/kodi-krypton
* $ make -C tools/depends/target/cmakebuildsys
* $ cd /kodi-krypton/build
$ make
$ make apk
you’ll get your apk in $HOME/kodi-krypton