Packaging android apk is so hard! who can help me

win7 64bit v3.2
using cocos compile - p android -ap 20

D:/Android/ndk/sources/cxx-stl/llvm-libc++/libcxx/include\type_traits:922:38: er
ror:
implicit instantiation of undefined template
‘std::__1::hashController::WeaponMenu
: public integral_constant<bool, __is_empty(_Tp)> {};

jni/…/…/Classes/Controller.cpp:16:2: error: cannot initialize object parameter

of type ‘cocos2d::Ref’ with an expression of type ‘Controller’
        controller->autorelease();

what is this error?

jni/…/…/Classes/Controller.cpp:34:69: error: cannot initialize a parameter of
      type ‘cocos2d::Node *’ with an rvalue of type ‘Controller *’
        _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this)
;

jni/…/…/Classes/Controller.cpp:48:8: error: no matching member function for
      call to ‘addChild’
        this->addChild(m_pRocker);

jni/…/…/Classes/Controller.cpp:187:8: error: no matching member function for
      call to ‘addChild’
        this->addChild(m_pAuto);

jni/…/…/Classes/Controller.cpp:223:9: error: no matching member function for
      call to ‘addChild’
                this->addChild(bar);

jni/…/…/Classes/Controller.cpp:266:10: error: no matching member function for
      call to ‘addChild’
                        this->addChild(SkillDis);

to test: make all the files in the directory of classes
the android.mk
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

$(call import-add-path,$(LOCAL_PATH)/…/…/cocos2d)
$(call import-add-path,$(LOCAL_PATH)/…/…/cocos2d/external)
$(call import-add-path,$(LOCAL_PATH)/…/…/cocos2d/cocos)

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

FILE_LIST := hellocpp/main.cpp  
FILE_LIST += $(wildcard $(LOCAL_PATH)/…/…/Classes/*.cpp)  
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)

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

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static

LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static

LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static

LOCAL_WHOLE_STATIC_LIBRARIES += spine_static

LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static

LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static

LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static

include $(BUILD_SHARED_LIBRARY)

$(call import-module,.)
$(call import-module,audio/android)

$(call import-module,Box2D)

$(call import-module,editor-support/cocosbuilder)

$(call import-module,editor-support/spine)

$(call import-module,editor-support/cocostudio)

$(call import-module,network)

$(call import-module,extensions)

  • mode is missing in cocos command you used.
    did you run the command from your project folder ?

try replacing this line

FILE_LIST += $(wildcard $(LOCAL_PATH)/…/…/Classes/*.cpp) [does this include child directories ? ]

with …/…/Classes/.cpp for each cpp used.
in case of child directories …/…/Classes/child-dir/.cpp

thanks for reply;

Convenient to compile,there is no child directiories.
all the files in the classes-directory!

jni/…/…/Classes/SparseGraph.h:720:17: error: implicit instantiation of
      undefined template ‘std::__1::basic_ofstream<char,
      std::__1::char_traits >’
  std::ofstream out(FileName);

why this? i can’t understand.

Are you using ndk-r9d ? using ndk 10 creates problem.

i’m not sure, but i have encountered such situations where std::ostringstream works well across devices whereas i used something else which was not recognised only by android. Some stuffs executes properly in VC++ and Xcode but not on android. Try substitute the function with some other. I know its not the proper answer you are looking for. But its the way it worked for me.

thanks very much