compiler-errorscocos2d-x-3.0cocos2d-android

Error occur at compiling the Cocos 2d-x project in android Studio


Cocos 2d-x-3.15.1 Error in android Studio

Error occur at the time of compiling the new project in android studio

enter image description here

EDIT

I've new error in cocos2dxXXXXXX file, added screenshot below :

enter image description here


Solution

  • #include <unistd.h> header is missing in ProcessCpuTracker.cpp file for NDK v15

    check this answer for more detail.


    EDIT

    Cocos2dxDownloader.java uses Apache HTTP Client which is removed in Android 6.0.

    There is a PR for this issue so you can use latest version or apply patch by yourself :

    1. Add android-async-http-1.4.9.jar inside cocos/platform/android/java/libs/ folder

    2. Minor changes (import statement) in Cocos2dxDownloader.java file