Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1191 closed defect/bug (fixed)

Cannot build the Android Sources on Ubuntu

Reported by: todd b Owned by: kamikaaze
Priority: major Milestone: version 0.5.1
Component: port/android Version: git master
Severity: hardcore Keywords: Android cmake build

Description (last modified by usul)

I am using all the dependencies for Ubuntu 12.04 as outlined in the wiki etc.

CMake works fine but running make produces the following

navit@navit:~/src/android-build$ make
[  0%] Building C object navit/fib-1.1/CMakeFiles/fib.dir/fib.c.o
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/syslimits.h:7:0,
                 from /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/limits.h:34,
                 from /home/navit/src/navit-svn/navit/fib-1.1/fib.c:33:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed/limits.h:168:61: error: no include path in which to search for limits.h
 #include_next <limits.h>  /* recurse down to the real one */
/home/navit/src/navit-svn/navit/fib-1.1/fib.c:34:20: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
compilation terminated.
make[2]: *** [navit/fib-1.1/CMakeFiles/fib.dir/fib.c.o] Error 1
make[1]: *** [navit/fib-1.1/CMakeFiles/fib.dir/all] Error 2
make: *** [all] Error 2

Googling this issue seems to suggest this might be a gcc issue but the fixes are all pretty specific to what is trying to be built

This is probably something simple but all the fixes I have tried have failed, any ideas?

Attachments (2)

cmake.results (11.9 KB) - added by todd b 9 years ago.
Output from cmake
android-build.tar.gz (255.7 KB) - added by todd b 9 years ago.
Contents of android-build dir

Download all attachments as: .zip

Change History (8)

comment:1 follow-up: Changed 9 years ago by sleske

Thanks for reporting the problem.

Could you please add some information:

Changed 9 years ago by todd b

Output from cmake

Changed 9 years ago by todd b

Contents of android-build dir

comment:2 in reply to: ↑ 1 Changed 9 years ago by todd b

Replying to sebastian leske:

Thanks for reporting the problem.

Could you please add some information:

Yes I followed that link and the dependencies link as well. I have attached the output from the cmake command and zipped the android-build directory

I have tried this on both x64 and x32 clean distros, with and without upgrades. CMake finishes with warnings but no errors.


All paths, support files, dependencies, skd/ndk's etc are exactly as in the wiki how to, again see attached files for output from cmake and content of android-build directory, make command still fails in the exact way specified previously

Thanks, I appreciate the help

comment:3 Changed 9 years ago by tryagain


I have not installed any android-specific item system-wide, all files are just laying under my home directory.

In your logs, I see calls to /usr/bin/gcc which is not the one from the android ndk. Also, your build process references include files from system-wide locations. But as you're cross compiling, build process should use compiler, includes and libraries specific to the target platform.

I use the following script to configure the build process.

export ANDROID_NDK=~/android/android-ndk-r6
export ANDROID_PLATFORM=$ANDROID_NDK/platforms/android-$ANDROID_API_LVL/arch-arm 

export SDK=~/android/android-sdk-linux_x86

export PATH=~/android/apache-ant-1.8.2/bin:$PATH:$ANDROID_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin:$SDK/tools

export SOURCE_PATH=../navit

comment:4 Changed 9 years ago by usul

  • Description modified (diff)
  • Keywords cmake build added; make removed
  • Milestone set to version 0.5.1

As full CMake support is a 0.5.1 goal, I suggest to schedule it for this release

comment:5 Changed 9 years ago by kamikaaze

  • Owner changed from cp15 to kamikaaze
  • Status changed from new to assigned


This Message about stdlib.h not found arises if the ndk gcc compiler is not in your PATH variable.

There was actually an Error in the Wiki. The line "export ANDROID_NDK=~/src/android-ndk-r6b" is obviously incorrect if you download the ndk-r8 I changed it to "export ANDROID_NDK=~/src/android-ndk-r8"

Remember to clear your build folder and rerun the cmake command again after changing your PATH Variables.

Please let us know if this fixes your build problems.

comment:6 Changed 9 years ago by todd b

  • Resolution set to fixed
  • Status changed from assigned to closed

Sorry to take so long to reply, yeah I figured that out quite a while back

I wrote a script that does everything that operates on Ubuntu 12.04 and grabs all dependencies, Navit Source, Android requirements and does a build.

If anyone is interested I put it up on git-hub

NOTE: It uses NDK r9d, platform tools 19.0.3, SDK 22.6.2 and sets the minimum to 9 and target to 19. It all seems to work fine with the newer stuff but it's somewhat configurable by changing the top level defines

Cheers, Todd

Last edited 9 years ago by todd b (previous) (diff)
Note: See TracTickets for help on using tickets.