[Android] error: 'CCPhysicsSprite' was not declared in this scope

Hi guys,

I was trying to build cocos2d-x jsb for android.

After creating the android project, I modified the Android.mk inside the jni directory as following:

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

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

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static chipmunk_static cocos_extension_static spidermonkey_static scriptingcore-spidermonkey

include $(BUILD_SHARED_LIBRARY)

$(call import-module,CocosDenshion/android) $(call import-module,cocos2dx) $(call import-module,external/chipmunk) $(call import-module,extensions) $(call import-module,scripting/javascript/spidermonkey-android) $(call import-module,scripting/javascript/bindings)

While executing the build_native.sh, I got errors:

Compile*+ thumb : scriptingcore-spidermonkey <= ScriptingCore.cpp
Compile*+ thumb : scriptingcore-spidermonkey <= cocos2d_specifics.cpp
Compile*+ thumb : scriptingcore-spidermonkey <= js_manual_conversions.cpp
Compile*+ thumb : scriptingcore-spidermonkey <= js_bindings_chipmunk_manual.cpp
/Users/henrysha/Workspaces/CoreTec/cocos2d-2.1beta3-x-2.1.1/HybridMig/HybridMig/proj.android/…/…/…/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp: In function ‘JSBool JSPROXY_CCPhysicsSprite_getCPBody(JSContext**, uint32_t, jsval**)’:
/Users/henrysha/Workspaces/CoreTec/cocos2d-2.1beta3-x-2.1.1/HybridMig/HybridMig/proj.android/…/…/…/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp:81:5: error: ‘CCPhysicsSprite’ was not declared in this scope
/Users/henrysha/Workspaces/CoreTec/cocos2d-2.1beta3-x-2.1.1/HybridMig/HybridMig/proj.android/…/…/…/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp:81:22: error: ‘real’ was not declared in this scope
/Users/henrysha/Workspaces/CoreTec/cocos2d-2.1beta3-x-2.1.1/HybridMig/HybridMig/proj.android/…/…/…/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp:81:47: error: expected primary-expression before ‘)’ token
/Users/henrysha/Workspaces/CoreTec/cocos2d-2.1beta3-x-2.1.1/HybridMig/HybridMig/proj.android/…/…/…/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp: In function ‘JSBool JSPROXY_CCPhysicsSprite_ignoreBodyRotation(JSContext**, uint32_t, jsval**)’:
/Users/henrysha/Workspaces/CoreTec/cocos2d-2.1beta3-x-2.1.1/HybridMig/HybridMig/proj.android/…/…/…/scripting/javascript/bindings/js_bindings_chipmunk_manual.cpp:98:2: error: ‘CCPhysicsSprite’ was not declared in this scope

Any idea?
Does anybody have done this before?

Solved!

After comparing with sample project Crystalcraze, I found that adding compile options ~~DCC_ENABLE_CHIPMUNK_INTEGRATION=1 would help.
Here is my new jni/Application.mk:
APP_STL := gnustl_static
APP_CPPFLAGS :=~~frtti ~~DCOCOS2D_DEBUG=1
APP_CPPFLAGS +=~~DCC_ENABLE_CHIPMUNK_INTEGRATION=1