Kodi Community Forum

Full Version: Android build compilation errors (Docker)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I tried to compile Kodi following the instructions at https://github.com/xbmc/xbmc/blob/master...Android.md
To do this, I set up a Dockerfile in order to reproduce the exact environment as described in the README.
However, I ran into a compilation error when I try to make the build tools and dependencies.

This is my Dockerfile:

Code:

FROM ubuntu:xenial

RUN apt-get update
RUN apt-get -y install git autoconf build-essential curl default-jdk gawk git gperf lib32stdc++6 lib32z1 \
lib32z1-dev libcurl4-openssl-dev unzip zlib1g-dev wget cmake python zip 

RUN useradd -ms /bin/bash kodi
USER kodi
WORKDIR /home/kodi

RUN git clone -b Krypton https://github.com/xbmc/xbmc kodi

RUN mkdir /home/kodi/Downloads
WORKDIR /home/kodi/Downloads

RUN wget https://dl.google.com/android/repository...333796.zip
RUN wget https://dl.google.com/android/repository...x86_64.zip
RUN mkdir -p $HOME/android-tools/android-sdk-linux
RUN unzip $HOME/Downloads/sdk-tools-linux-4333796.zip -d $HOME/android-tools/android-sdk-linux
RUN unzip $HOME/Downloads/android-ndk-r16b-linux-x86_64.zip -d $HOME/android-tools
RUN cd $HOME/android-tools/android-sdk-linux/tools/bin && yes | ./sdkmanager --licenses && ./sdkmanager \
--licenses && ./sdkmanager platform-tools && ./sdkmanager "platforms;android-26" && ./sdkmanager "build-tools;25.0.3"

WORKDIR /home/kodi/android-tools/android-ndk-r16b/build/tools
RUN ./make-standalone-toolchain.sh --install-dir=$HOME/android-tools/arm-linux-androideabi-4.9-vanilla/android-21 --platform=android-21 --toolchain=arm-linux-androideabi-4.9 --stl=libc++
RUN 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

WORKDIR /home/kodi/kodi/tools/depends
RUN ./bootstrap
RUN ./configure --with-tarballs=/home/kodi/android-tools/xbmc-tarballs --host=arm-linux-androideabi --with-sdk-path=/home/kodi/android-tools/android-sdk-linux --with-ndk=/home/kodi/android-tools/android-ndk-r16b --with-toolchain=/home/kodi/android-tools/arm-linux-androideabi-4.9-vanilla/android-21 --prefix=/home/kodi/android-tools/xbmc-depends

The docker builds fine, but when I run "make" the following error occurs:

Code:

  CXX      libpcrecpp_la-pcrecpp.lo
In file included from /home/kodi/android-tools/arm-linux-androideabi-4.9-vanilla/android-21/include/c++/4.9.x/initializer_list:47:0,
                 from /home/kodi/android-tools/arm-linux-androideabi-4.9-vanilla/android-21/include/c++/4.9.x/algorithm:639,
                 from /home/kodi/android-tools/arm-linux-androideabi-4.9-vanilla/android-21/include/c++/4.9.x/__string:56,
                 from /home/kodi/android-tools/arm-linux-androideabi-4.9-vanilla/android-21/include/c++/4.9.x/string_view:169,
                 from /home/kodi/android-tools/arm-linux-androideabi-4.9-vanilla/android-21/include/c++/4.9.x/string:470,
                 from pcrecpp.cc:43:
/home/kodi/android-tools/arm-linux-androideabi-4.9-vanilla/android-21/include/c++/4.9.x/cstddef:44:25: fatal error: stddef.h: No such file or directory
 #include_next <stddef.h>
                         ^
compilation terminated.
Makefile:2244: recipe for target 'libpcrecpp_la-pcrecpp.lo' failed
make[4]: *** [libpcrecpp_la-pcrecpp.lo] Error 1
make[4]: Leaving directory '/home/kodi/kodi/tools/depends/target/pcre/arm-linux-androideabi-android-21'
Makefile:1310: recipe for target 'all' failed
make[3]: *** [all] Error 2

Does anybody know what causes this issue?
You don't follow the readme for the version you want to build. Correct one for building Krypton is the one in that branch (https://github.com/xbmc/xbmc/blob/Krypto...ME.android).
My bad!

Thank you, it works perfectly now!