[Solved]NDK Compiling error

Hi

I am using NDK r15c, while compiling for android I got this error

Android NDK: ERROR:/MyProject/cocos2d/external/freetype2/prebuilt/android/Android.mk:cocos_freetype2_static: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that /MyProject/cocos2d/external/freetype2/prebuilt/android/x86_64/libfreetype.a exists or that its path is correct

So I add APP_ABI := armeabi in my Application.mk
Now, above issue got fixed, but I got another error when I compile

[armeabi] Compile++ thumb: cocos2dxandroid_static <= ProcessCpuTracker.cpp
/MyProject/cocos2d/cocos/platform/android/jni/ProcessCpuTracker.cpp: In function ‘std::vector<_CpuInfo> readProcStat()’:
/MyProject/cocos2d/cocos/platform/android/jni/ProcessCpuTracker.cpp:69:54: error: ‘read’ was not declared in this scope
const int len = read(fd, buffer, sizeof(buffer)-1);
^
/MyProject/cocos2d/cocos/platform/android/jni/ProcessCpuTracker.cpp:70:13: error: ‘close’ was not declared in this scope
close(fd);

cocos2dx version is 3.15.1
Platform: Mac

I will have a try with NDK r15c.

I use NDK r15c to compile cpp-empty-test with latest github codes, not meet compiling error. I will try v3.15.1.

Yep, it has problem in v3.15.1. You can just remove ProcessCpuTracker.cpp out of cocos/platform/android/Android.mk. The file is useless.

Thanks

Now its working after removing ProcessCpuTracker.cpp from Android.mk

UnboundLocalError: local variable ‘gradle_support_ndk’ referenced before assignment,…please slove this for me tired

UnboundLocalError: local variable ‘gradle_support_ndk’ referenced before assignment …please slove this for me i am gettting this Error while compiling cocosdx project in android studio

I think it is another issue, could you please create a new ticket? And please describe your issue as detail as possible, such as the engine version, the android studio version and so on.