Ubuntu 12.04 LTS+cocos2d-x2.1.4+android-ndk-r9 error: format not a string literal and no format arguments!

Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := game_shared

LOCAL_MODULE_FILENAME := libgame

LOCAL_SRC_FILES := hellocpp/main.cpp …/…/Classes/AppDelegate.cpp …/…/Classes/HelloWorldScene.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/…/…/Classes

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static

include $(BUILD_SHARED_LIBRARY)
$(call import-add-path,$(LOCAL_PATH)/…/…/…) $(call import-add-path,$(LOCAL_PATH)/…/…/…/cocos2dx/platform/third_party/android/prebuilt)

$(call import-module,CocosDenshion/android) $(call import-module,cocos2dx) $(call import-module,extensions)

output:
jni/…/…/…/cocos2dx/platform/android/CCCommon.cpp: In function ’void cocos2d::CCLog(char const**, …)’:
jni/…/…/…/cocos2dx/platform/android/CCCommon.cpp:44:72: error: format not a string literal and no format arguments
jni/…/…/…/cocos2dx/platform/android/CCCommon.cpp: In function ’void cocos2d::CCLuaLog’:
jni/…/…/…/cocos2dx/platform/android/CCCommon.cpp:54:77: error: format not a string literal and no format arguments
cc1plus: some warnings being treated as errors
make:***** Error 1
*** Build Finished**

help me! T-T

Exact same problem here! One of our devs uses arch linux. He has the same issue.

Try to replace
__android_log_print(ANDROID_LOG_DEBUG, "cocos2d-x debug info", buf);
with
__android_log_print(ANDROID_LOG_DEBUG, "cocos2d-x debug info", "%s", buf);
Does it help?

yes it fixes the compile error

Compile++ thumb : cocos2dx_static <= CCCommon.cpp

the next errors that popped up are
/Users/……/Documents/cocos2dx/platform/android/CCFileUtilsAndroid.cpp: In member function ‘virtual unsigned char* cocos2d::CCFileUtilsAndroid::getFileData(char const**, char const**, long unsigned int*)’:
/Users/……/Documents/cocos2dx/platform/android/CCFileUtilsAndroid.cpp:156:9: error: format not a string literal and no format arguments [-Werror=format-security]
cc1plus: some warnings being treated as errors

ok, to fix the next errors that pop up, in your “proj.android/jni/Application.mk” file, add the line

APP_CFLAGS += ~~Wno-error=format-security
so in my file it looks like
APP_STL := gnustl_static
APP_CPPFLAGS :=~~frtti ~~DCOCOS2D_DEBUG=1
APP_CFLAGS +=~~Wno-error=format-security

Then run the build_native.sh and it should build completely. You will still see the security warnings but it won’t count them as errors.
According to other threads adressing this issue, this is a temporary problem that will hopefully be fixed by a future cocos2dx release