Kodi Community Forum
Android Compiling source code for android error - solved - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+---- Forum: Android Development (https://forum.kodi.tv/forumdisplay.php?fid=184)
+---- Thread: Android Compiling source code for android error - solved (/showthread.php?tid=182976)



Compiling source code for android error - solved - nektahiti - 2014-01-11

Hey everyone!

I wanted to make a few small changes to the xbmc PIVOS source code and compile it myself...

Source is here: https://github.com/Pivosgroup/xbmc/

I am following the Readme (https://github.com/Pivosgroup/xbmc/blob/master/docs/README.android) to the best of my ability...

I am using Ubuntu 13.10

Here is what I did:

sudo apt-get install build-essential default-jdk git curl autoconf unzip zip zlib1g-dev gawk gperf cmake

# Install SDK packages (downloaded the latest sdk on the android dev site)

Code:
cd $HOME/xbmc-build/android-sdk-linux/tools
./android update sdk -u -t platform,platform-tool

# Install toolchain

Code:
mkdir $HOME/xbmc-build/android-toolchain
cd $HOME/xbmc-build/android-ndk-r7-crystax-5.beta3/build/tools
./make-standalone-toolchain.sh --ndk-dir=../../ --install-dir=$HOME/xbmc-build/android-toolchain/android-9 --platform=android-9

# Set debug Key

Code:
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

# Clone repo

Code:
cd $HOME/xbmc-build
git clone ssh://[email protected]/myrepo/xbmc.git xbmc-git
cd xbmc-git
git remote add -f upstream https://github.com/Pivosgroup/xbmc.git
git submodule update --init addons/skin.touched

# Build Dependancies

Code:
mkdir $HOME/xbmc-build/xbmc-tarballs
cd $HOME/xbmc-build/xbmc-git/tools/android/depends
./bootstrap
export XBMC_ANDROID_NDK=$HOME/xbmc-build/android-ndk-r7-crystax-5.beta3
export XBMC_ANDROID_SDK=$HOME/xbmc-build/android-sdk-linux
export XBMC_ANDROID_TARBALLS=$HOME/xbmc-build/xbmc-tarballs
./configure --with-toolchain=$HOME/xbmc-build/android-toolchain/android-9
make -j20

(At this point I do not get the dependencies built message at the end Sad )

Code:
cd $HOME/xbmc-build/xbmc-git/tools/android/depends/xbmc

make -j8

which end with this error:

Quote:Makefile.am: installing `./INSTALL'
autoreconf: Leaving directory `lib/libdvd/libdvdnav'
make[1]: Leaving directory `/home/oj/xbmc-build/xbmc-git'
make[1]: Entering directory `/home/oj/xbmc-build/xbmc-git'
make[1]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
Warning: No doxygen installed. The Api will not have any docstrings.
mkdir -p xbmc/interfaces/python/generated/doxygenxml
Swig not found, it will be used if found after configure.
This is not necessarily an error.
make[1]: *** [swig-not-found] Error 1
make[1]: Leaving directory `/home/oj/xbmc-build/xbmc-git'
make: *** [../../../..//libxbmc.so] Error 2

Thanks for any help debugging this issue. I would really like to setup a build environment for XBMC android...


RE: Compiling source code for android error - Koying - 2014-01-11

Redo the "# Build Dependencies" step with just "make", without the "-j20".
No hope to build xbmc itself if the dependencies are not properly built.


RE: Compiling source code for android error - nektahiti - 2014-01-11

Will do thanks!

Thanks for the pointer, turns out it could not download fontconfig, so I got it from here http://ftp.vim.org/mediaplayer/xbmc/build-deps/darwin-libs/

Some more missing dependencies from the official repo where the build script tries to find them:

fontconfig-2.8.0.tar.gz
Python-2.6.5.tar.bz2
libssh2-1.2.7.tar.gz
curl-7.21.3.tar.bz2

Sometimes if it fails I have to start my build all over again from ./configure so there might be some more missing still. Will update and report back Smile


RE: Compiling source code for android error - nektahiti - 2014-01-11

Well there was quite a few more dependencies missing, but it finally built in the end!

I am now compiling the apk and hope it works out Smile

Since this is my first time compiling a project for android, let's say I add changes to my xbmc souce code, from what step do I have to start again to build a new apk from the new code?

Cheers Smile


RE: Compiling source code for android error - Montellese - 2014-01-11

You will have to run "make" and "make apk" in XBMC's root directory.

If the dependency build fails to download a package often a
Code:
make -C <path/to/the/failed/dependency> clean
will be enough to properly retry. At least that's what I did when some download of a package failed half-way or whatever. Sometimes you also have to manually remove the bad package from your tarball directory so that it is re-downloaded.


RE: Compiling source code for android error - nektahiti - 2014-01-12

Thanks for you guys help.

After managing to get my dependencies to build I tried to make it from $HOME/xbmc-build/xbmc-git/tools/android/depends/xbmc and did a "make"

This endend in the same error: make: *** [../../../..//libxbmc.so] Error 2, which got me pretty depressed on this...

Then I tried what Montellese suggested, did a "make" from the root directory.

And I got an XBMC succesfully built message!!!

But alas, when doing "make apk" I get this error:

make[1]: /home/oj/xbmc-build/android-sdk-linux/platform-tools/aapt: Command not found
make[1]: *** [extras] Error 127
make[1]: Leaving directory `/home/oj/xbmc-build/xbmc-niu/tools/android/packaging'
make: *** [apk] Error 2

Sad


RE: Compiling source code for android error - Montellese - 2014-01-12

IIRC aapt was moved to somewhere else in the recent android SDKs. I'm sure google will help you out as I can't remember any details.

EDIT: See http://stackoverflow.com/questions/16927306/could-not-find-tool-aapt-please-provide-proper-android-sdk-directory-path-as-co


RE: Compiling source code for android error - nektahiti - 2014-01-12

Thanks for the heads up! I was just about to report with this link that helped me solve the issue:

http://forum.xbmc.org/showthread.php?tid=170969

Smile