Compile Assimp Open Source Library For Android

Compile Assimp Open Source Library For AndroidCompile Assimp Open Source Library For Android

Assimp is very strong library to load 3d models. the library supports various formats like 3DS, DAE, OBJ and many more formats and the library can be ported to the android platform using the native development kit for android.

After few days of fighting how to compile the library and use it, finally decided to post the tutorial for other developers with the same goal.
(the instructions involves running commands from command line, I used both windows and mac to run the scripts so examples will contain both, basic steps are the same)

The Compilation process will take from two phases :
– Compile using cmake (which will generate makefile)
– Compile using make (which will generate so shaed library file)

for preperation, android ndk, android sdk should be already installed, in addition need to download android toolchain scripts that cmake will use during the compilation so go to and download zip file contains all the android-cmake files (extract to root folder with android sdk,ndk)

also need to download the cmake command line or gui tool ( )
in addition in windows should use cygwin to run the scripts, I used both cygwin and mac terminal to achieve the goal.

1. Set up android toolchain
export NDK_PATH=/path/to/your/android/ndk/
not go to android-ndk-r8c\build\tools
run the command:
sh –platform=android-8 –ndk-dir=$NDK_PATH –install-dir=/Android/sdk/android-toolchain –toolchain=arm-linux-androideabi-4.4.3
which will build file scripts of the toolchain
now run the command
export ANDROID_NDK_TOOLCHAIN=$HOME/Android/sdk/android-toolchain
and also
export ANDTOOLCHAIN=$HOME/Android/android-cmake/toolchain/android.toolchain.cmake
to the path need to add :
export PATH=$PATH:$HOME/Android/sdk/tools
export PATH=$PATH:$HOME/Android/sdk/platform-tools
export PATH=$PATH:$HOME/Android/sdk/android-toolchain/bin

so lets begin, download the last source of assimp library from and open terminal(cygwin or mac terminal) , go to assimp directory and type :
mkdir buildandroid
cd buildandroid

this will create files and folders in the build directory, now go to the file link.txt inside : buildandroid => code => cMakeFiles => assimp.dir => link.txt
search for the string -soname, and remove the .3 from the extension of the library (if not it will make problems in loading later from the android)
do the same thing with file name relink.txt

now go back to the root directory of buildandroid and run :
process of building will begin, the shared library will be in parent lib folder and wll consist from symbolic links and so library which will called remove the version number makeing the file name only be

(already pre-compiled assimp 3.0 version for android download here

About the Author

Android Developer