No Incremental Build for NDK (Cocos2Dx sources are always compiling)

No Incremental Build for NDK (Cocos2Dx sources are always compiling)
0.0 0


I have used the famous tutorial “Cocos2D-X for iOS and Android: Getting Started” and everything works now, except building with NDK ALWAYS compiles ALL files (so it’s not incremental). I mean I would accept my project files to be compiled always, but it’s rather tedious to compile all Cocos2d-x sources! Does everyone have the same experience? Actually Cocos2dx is already split in a separate library, so it’s problem with NDK (using r8c)?


I have the same issue and I’d like to understand why it recompiles everything every time and how to avoid it.


Could you post the Tutorial link, platform, and method to compile please?

I work on Linux, with NDK 8 and work fine. First time compile cocos2d-x lib, and my code, the rest only my changes in code.

Check your compiling-script, look for “ndk-build” and be sure that ~~B option is NOT active.~~B always force recompilation.



Running on Win32 using Eclips & Cygwin

I did not manage to compile using under cygwin, so I created my own build_native.cmd which calls build-ndk.cmd in the same way does. But I can see there is no any special options given to compiler.


What part of the code are you changing? What is the log result on compilation?


I change nothing. Just call “build” again and it compiles all over again ;(


To cross check; I’ve just managed to compile using - the same result - it’s recompiling all the sources each time.


This is a known issue for NDK r8c on Mac OS X.
I have reported this to Google before release but these smart guys ignored it, then realized their error after r8c release, since many people complained about it.
They merged a fix into AOSP project a few days after.

See here :!topic/android-ndk/EFA21mVVqH0
The patch is to change a single line 289 in build/core/ from

$1: $$(__ndk_file_dir)


$1: | $$(__ndk_file_dir)


Romain, thank you very much.


Merci also from my side! It works now as expected!


Tags for search engines: NDK Eclipse rebuilds cocos every run


Thanks. I had the same problem on Windows 8.