proj.android目录下的AndroidManifest.xml文件中设置横屏(landscape)竖屏(portrait)。
2、proj.android目录下新建个名为assets的文件夹,将resources下的资源全部复制进去。
3、proj.android\jni下的Android.mk文件的修改。
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := cocos2dcpp_shared
LOCAL_MODULE_FILENAME := libcocos2dcpp
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
此处添加自己新建的cpp文件
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes\
$(LOCAL_PATH)/../../cocos2d/extensions\ //此处是因为用到了cocos-ext.h头文件。
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static//用到extension
LOCAL_WHOLE_STATIC_LIBRARIES += Box2d_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static//cocostudio
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_ui_static
include $(BUILD_SHARED_LIBRARY)
$(call import-module,2d)
$(call import-module,audio/android)
$(call import-module,Box2D)
$(call import-module,extensions)
$(call import-module,editor-support/cocostudio)
$(call import-module,ui)
4、proj.android\jni下的Application.mk文件下添加 NDK_TOOLCHAIN_VERSION = 4.9 以解决版本低,不适应C++11新特性。当然你用的Ndk的toolchain文件夹下有4.9才行.
5、在项目目录下运行cocos run -p android 命令。