Kodi Community Forum

Full Version: [Android] - Error 2 building on Mac OS X
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I've been trying to get XBMC/Kodi building for a while now, and I finally got past the issue with 'specify SDK directory' or whatever, and the actual build starts after I use the ./bootstrap and ./configure (with parameters), but after several minutes of building, it fails with Error 2. I've also included the config log on pastebin

Here's my ./configure setup
Code:
sudo ./configure --with-tarballs=/opt/xbmc-tarballs --host=arm-linux-androideabi --with-sdk-path=/Users/ryan/Development/Android/sdk --with-ndk=/Users/ryan/Development/Android/Libraries/android-ndk-r9d --with-toolchain=/opt/arm-linux-androideabi-4.8-vanilla/android-14 --prefix=/opt/xbmc-depends

After that I run the
Code:
sudo make -j 20

Here's the error
Code:
cp libcrypto.pc /opt/xbmc-depends/arm-linux-androideabi-android-14/lib/pkgconfig
chmod 644 /opt/xbmc-depends/arm-linux-androideabi-android-14/lib/pkgconfig/libcrypto.pc
cp libssl.pc /opt/xbmc-depends/arm-linux-androideabi-android-14/lib/pkgconfig
chmod 644 /opt/xbmc-depends/arm-linux-androideabi-android-14/lib/pkgconfig/libssl.pc
cp openssl.pc /opt/xbmc-depends/arm-linux-androideabi-android-14/lib/pkgconfig
chmod 644 /opt/xbmc-depends/arm-linux-androideabi-android-14/lib/pkgconfig/openssl.pc
rm -f /opt/xbmc-depends/arm-linux-androideabi-android-14/lib/libcrypto.so*
rm -f /opt/xbmc-depends/arm-linux-androideabi-android-14/lib/libssl.so*
rm -rf /opt/xbmc-depends/arm-linux-androideabi-android-14/lib/libcrypto.*dylib*
rm -rf /opt/xbmc-depends/arm-linux-androideabi-android-14/lib/libssl.*dylib*
touch .installed-arm-linux-androideabi-android-14
make: *** [target/.installed-arm-linux-androideabi-android-14] Error 2

Here's the pastebin to my config.log
Pastebin
Don't do the - j 20, the actual error will be more obvious.
Also why sudo'ing? You don't need root to build.
sudo will poison your build root ... do it all again from scratch. Also why do you open yet another thread ... there are already 2 which are handling building for android on osx - yet a third one for the same thing?
sudo-ing because local user doesn't have r/w for /opt/. I can change that path I guess, but this just seemed to make it easier. I opened a new thread because it was a different error than they had in the other threads.
Alright, I cleared everything, created a brand new clone of xbmc on my local machine, followed every step to the letter, and it still won't build.

Code:
./configure --with-tarballs=/Users/ryan/Development/Android/ndk/xbmc-tarballs --host=arm-linux-androideabi --with-sdk-path=/Users/ryan/Development/Android/sdk --with-ndk=/Users/ryan/Development/Android/Libraries/android-ndk-r9d --with-toolchain=/Users/ryan/Development/Android/ndk/arm-linux-androideabi-4.8-vanilla/android-14 --prefix=/Users/ryan/Development/Android/ndk/xbmc-depends

Error
Code:
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... /usr/bin/gcc
checking whether the C compiler works... no
configure: error: in `/Users/ryan/Development/Android/Personal/Source/xbmc/tools/depends/target/pcre/arm-linux-androideabi-android-14':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[2]: *** [arm-linux-androideabi-android-14] Error 77
make[1]: *** [pcre] Error 2
make: *** [target/.installed-arm-linux-androideabi-android-14] Error 2

Config.log

My config.log ends with exit 0 like there were no problems, however, if I try to run 'make' after running that previous config line, it builds for about 5 minutes, then gives the same Error 77 in make.


[Edit]
I've now managed to fix this error (I needed to run "sudo xcodebuild -license" and agree to the licensing information). However, now when I run it, I get a fresh set of errors. It's almost like the output is seeing my system as a Linux box, rather than OS X, based on the headers that it can't seem to find.

Code:
XBTFWriter.cpp:29:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
         ^
1 error generated.
make[4]: *** [XBTFWriter.o] Error 1
make[3]: *** [all] Error 2
make[2]: *** [x86_64-darwin14.0.0-native/TexturePacker] Error 2
make[1]: *** [TexturePacker] Error 2
make: *** [native/.installed-x86_64-darwin14.0.0-native] Error 2


The first thing that it cannot find, is "malloc.h". However, in OS X it's located in "/usr/include/malloc/malloc.h", rather than "/usr/include/malloc.h". I copied the malloc header file into /usr/include, but then I end up with yet another issue.

Code:
Packer.o TexturePacker.cpp &&\
    mv -f $depbase.Tpo $depbase.Po
In file included from TexturePacker.cpp:40:
In file included from ./cmdlineargs.h:25:
/Users/ryan/Development/Android/Personal/Source/xbmc/tools/depends/native/TexturePacker/x86_64-darwin14.0.0-native/../../../../../xbmc/linux/PlatformDefs.h:59:10: fatal error:
      'sys/sysinfo.h' file not found
#include <sys/sysinfo.h>
         ^
1 error generated.
make[4]: *** [TexturePacker.o] Error 1
make[3]: *** [all] Error 2
make[2]: *** [x86_64-darwin14.0.0-native/TexturePacker] Error 2
make[1]: *** [TexturePacker] Error 2
make: *** [native/.installed-x86_64-darwin14.0.0-native] Error 2
Are you using the 64bit ndk for darwin by any chance? Please try again using this one: https://dl.google.com/android/ndk/androi...86.tar.bz2 (64bit ndk will not work because of a damned typo in the NDK_VER define).
It doesn't look like that was the issue... still seeing this:
Code:
XBTFWriter.cpp:29:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
         ^
1 error generated.
make[4]: *** [XBTFWriter.o] Error 1
make[3]: *** [all] Error 2
make[2]: *** [x86_64-darwin14.0.0-native/TexturePacker] Error 2
make[1]: *** [TexturePacker] Error 2
make: *** [native/.installed-x86_64-darwin14.0.0-native] Error 2

Also, the URL for the link you posted needs to include "-x86"
https://dl.google.com/android/ndk/androi...86.tar.bz2

Building off of the latest master (the direct one, not a fork), OS X 10.10, rMBP 16GB ram, more than 100GB free space, etc. etc.
ok ... give me a bit ... i see the issue ... texturepacker and others are the issue ...
holy crap that toolchain is broken too ... google is to stupid to define the NDK_VER the same on all platforms *grrrrr*
https://github.com/Memphiz/xbmc/commits/fixnative

wip - still some hard nuts to crack here but this should get you going near to the end ... (i know this doesn't help you at all).

Won't have time to work on it over the weekend...
(2015-01-23, 03:42)Memphiz Wrote: [ -> ]https://github.com/Memphiz/xbmc/commits/fixnative

wip - still some hard nuts to crack here but this should get you going near to the end ... (i know this doesn't help you at all).

Won't have time to work on it over the weekend...

That's okay! I appreciate you looking into this as much as you have already.
@RBWare you could do me a favour and try it out from my tree:

https://github.com/Memphiz/xbmc/commits/fixnative

before i do a pull request to mainline. Please follow the (adapted) docs/README.android as good as possible - this should work then. I think the trickiest part is to ensure to have java 1.6 running (you figure that one out with google pretty quick) - and that you ensure to do all the stuff inside of the case sensitive dmg image.

Please report back.
Started fresh using your updated docs/README.android, still seeing the same build errors with malloc.h.

Here's the pastebin of the last part of the output before the "make" command failed.
http://pastebin.com/HJV3sPic

Here's the configure that I used.

Code:
./configure --with-tarballs=/Volumes/android-dev/xbmc-depends/tarballs --host=arm-linux-androideabi --with-sdk-path=/Volumes/android-dev/sdk --with-ndk=/Volumes/android-dev/android-ndk-r10d --with-toolchain=/Volumes/android-dev/android-toolchain/android-14 --prefix=/Volumes/android-dev/android/xbmc-depends
I can see that you are not using my branch - its not enough to follow the readme - there are 3 commits in my branch in regard to adding NATIVE_ARCH_DEFINES - i can see that those are not in effect on your output because else it would never define -DTARGET_ANDROID for TexturePacker ...

In a nutshell (just in case you are not aware)

Code:
cd <your xbmc source tree>
git remote add memphiz git://github.com/Memphiz/xbmc.git -f
git checkout fixnative
#clean out the crap
git clean -xffd

After that start do it again from point 5.1 (your configure line looks good)
Yeah I just realized that about 10 minutes ago... I messed that up pretty bad, my fault. The dependencies just built out correctly no problem. I'm having it build out the rest of the apk right now. I'll update this post with success/failure.

[Edit]
Code:
mkdir -p xbmc/obj
Creating package...
Signing...
jar signed.

Warning:
No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2044-05-11) or after any future revocation date.
/Volumes/android-dev/kodi-android/kodiapp-armeabi-v7a-debug.apk created

100% functional on OS X (10.10), based on your fixnative branch. Thank you very much!
Pages: 1 2