The output folder I set contains these prebuilt libraries after I do a build (android/x86 and android/armeabi-v7a):
libcocos2d.a
libcocos2d_android.a
libflatbuffers.a
libpvmp3dec.a
librecast.a
libtinyxml2.a
libtremolo.a
libunzip.a
libxxhash.a
Once they’re built, I change the line in build.gradle to:
arguments “-DGEN_COCOS_PREBUILT=OFF”, “-DUSE_COCOS_PREBUILT=ON”
but I get this error on build:
cocos2d\cocos\math/MathUtil.cpp:114: error: undefined reference to ‘android_getCpuFamily’
cocos2d\cocos\math/MathUtil.cpp:114: error: undefined reference to ‘android_getCpuFeatures’
because of this:
– can’t find cocos prebuilt library: cpufeatures
I’m not sure what is going on. Could someone test this please and let me know if it actually works for you, just in case it’s an issue specific to my build process.
EDIT: So, I can see that libcpufeatures.a is being built (with GEN_COCOS_PREBUILT=ON), but it is never copied to the output library folder. Is this happening for anyone else??
else()
include(AndroidNdkModules)
android_ndk_import_module_cpufeatures()
# here
set(CPUFEATURES_LIBRARIES cpufeatures)
endif()
The reason is we used custom AndroidNdkModules.cmake times ago, we deleted it when reducing the cmake modules inside cocos2d-x, for those modules are installed with cmake.