How do I skip rebuilding of google play service library every time I build the project. Right now I am using following cmd:
cocos compile -p android
Thanks in advance
.
I don’t think it takes that much time to compile it
It takes much more if you need recompile full project with cocos2d-x libs
@energyy my compilation process is taking atleast 4 minutes every time. It is really frustrating.Can you please guide me how to reduce this time.
One way to reduce the compilation time of your C++ codes is to avoid making changes to the commonly included header files. If you have a header file that is included by every single .cpp file you have and it is always modified, you will face a lot of re-compilation time. If you have such a header file and it mainly holds the constants which you are using in the game, then I would suggest you use a plist to hold these constants.
Hi @duracellrabbid actually what @energyy suggested seems to be correct. Compiling cocos2dx libs is taking the real time. I am using the cocos compile cmd. Is there a way to optimise the process?
Usually when u first time compile project it really takes time, I hope u using -j flag when running compile:
cocos run -p android -j 4
It will compile your source code in 4 threads and will be much faster.
After compiled if you touch Android.mk or Application.mk files in JNI folder , all files will be recompiled. Otherwise only incremented changes will be compiled.
Second option is to precompile cocos2d-x libraries, then you compiling only your Classes folder, there was topic how to do this.
Thanks for reply @energyy I was not using -j flag but using it also seems to make no difference. It is still taking 4 mins on average. And yes I saw the discussion thread for precompiled libraries…will try that sometime.
If you saying it’s really 4 minutes for compile little change, you have issues with you MAC/PC, or you connected tons of third party SDK’s normal time for recompile little change should take like 1minute or less. Try to post here you compile log, to see what exactly happens on your side.
@energyy Please have a look at the attached compile output compile-log.zip (7.8 KB)
I am using only google play services as external library. It could well be just my pc issue as I am using windows laptop with 3gb ram and i3 processor. But still it would be really helpful if you can have look at logs and make sure everything is right from my side 
So my suggestions would be:
- Put SSD disk, it will be x2 faster
seems u using HDD - Also you linking google play services which are located in Android SDK folder, it is bad practice. Copy google play services to different folder and include it from there to project. Also I would not recommend to use latest google play services 7.8.0 as from my experience it adding extra 1mb to app size and adding tons of strange permissions and not needed functionality and files. I’m usually using 7.3.0 or 7.5.0.
- Cocos2d-x 3.7+ supporting android studio, I would recommend you to switch from eclipse and use it instead, it is less buggy and more predictable compile.
Thanks @energyy for your suggestions 