Cocos2.2打包apk失败

新手第一次打包apk,打包的时候出现这个错误

StaticLibrary : libcpufeatures.a
SharedLibrary : libcocos2dcpp.so
./obj/local/armeabi/objs/cocos2dcpp_shared///Classes/GameObject/Bird.o:Bird.cpp:vtable for Bird: error: undefined reference to ‘cocos2d::Sprite::setDisplayFrameWithAnimationName(std::string const&, int)’
./obj/local/armeabi/objs/cocos2dcpp_shared///Classes/GameObject/BlackCloud.o:BlackCloud.cpp:vtable for BlackCloud: error: undefined reference to ‘cocos2d::Sprite::setDisplayFrameWithAnimationName(std::string const&, int)’
./obj/local/armeabi/objs/cocos2dcpp_shared///Classes/GameObject/SpecialTool.o:SpecialTool.cpp:vtable for SpecialTool: error: undefined reference to ‘cocos2d::Sprite::setDisplayFrameWithAnimationName(std::string const&, int)’
collect2.exe: error: ld returned 1 exit status
make.exe: *** Error 1

我写的这三个类时派生于Sprite的,这错误好像是说他们的虚函数表中没有setDisplayFrameWithAnimationName这个函数,但是打开CCSprite.h文件是有这个函数的声明的啊,而且在VS2012中写完代码运行的时候都没有提示这个,这是为什么啊,应该怎么改呢,求大神解答一发。。。
另外,cocos2dx是3.5版本,就是frameworks中自带的那个

下面是打包中输出的全部信息:

发布项目成功
Based on: cocos2d-x-3.5
Running command: upgrade
Current version ‘cocos2d-x-3.5’ is same with target version ‘cocos2d-x-3.5’. It’s NOT necessary to upgrade project.

Based on: cocos2d-x-3.5
Updated project.properties
Updated local.properties
Updated file F:\Cocos\Projects\BalloonFly\proj.android\proguard-project.txt
Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml
make.exe: Entering directory F:/Cocos/Projects/BalloonFly/proj.android' StaticLibrary : libcpufeatures.a SharedLibrary : libcocos2dcpp.so ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/GameObject/Bird.o:Bird.cpp:vtable for Bird: error: undefined reference to 'cocos2d::Sprite::setDisplayFrameWithAnimationName(std::string const&, int)' ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/GameObject/BlackCloud.o:BlackCloud.cpp:vtable for BlackCloud: error: undefined reference to 'cocos2d::Sprite::setDisplayFrameWithAnimationName(std::string const&, int)' ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/GameObject/SpecialTool.o:SpecialTool.cpp:vtable for SpecialTool: error: undefined reference to 'cocos2d::Sprite::setDisplayFrameWithAnimationName(std::string const&, int)' collect2.exe: error: ld returned 1 exit status make.exe: *** Error 1 make.exe: Leaving directory F:/Cocos/Projects/BalloonFly/proj.android’
Running command: compile
Building mode: debug
Android platform not specified, searching a default one…
running: ‘“F:\Cocos\Android\android-sdk-windows\tools\android” update project -t android-20 -p F:\Cocos\Projects\BalloonFly\proj.android’
building native
NDK build mode: release
NDK_TOOLCHAIN_VERSION: 4.9
running: ‘“F:\android-ndk-r10d\ndk-build” -C F:\Cocos\Projects\BalloonFly\proj.android -j3 NDK_MODULE_PATH=F:\Cocos\Framework\frameworks/cocos2d-x-3.5;F:\Cocos\Framework\frameworks/cocos2d-x-3.5/cocos;F:\Cocos\Framework\frameworks/cocos2d-x-3.5/external NDK_TOOLCHAIN_VERSION=4.9’
Ndk build failed!
项目打包失败

你是不是又重新声明了setDisplayFrameWithAnimationName。然后没有实现。或者没有加入android.mk

没有啊,完全没动引擎的东西。不知道该怎么弄才好,你用的cocos2dx和那些NDK什么的都是什么版本的啊

我遇到了跟楼主一样的问题,我这边是iOS完全正常,android一编译就是楼主这个错,而且我发现3.5巨坑啊,编译只能用cocos了,还让不让人用eclipse调试了,这么大的变化还tm没有一个文档说明一下,这酸爽不敢相信啊,看你还敢不敢跟着瞎升级了!

我甚至怀疑官方是不是忘记给3.5的android c++代码重新编译一份新的预编译库还用的之前某个版本的了

额,最后还是换回3.3了,并不该更新、、、

楼主一定是用studio创建的项目:11::11::11:这有个坑啊…我尝试过了,同样的代码,studio创建的有这个问题,但是用引擎通过命令行创建的,没问题。今天被这问题坑了好久:12::12:

是的,所以我专门开了个帖子吐槽cocos http://www.cocoachina.com/bbs/read.php?tid-298290.html,我这也是恨铁不成钢啊

原来studio还可以创建项目,一直都是用命令创建的

这个问题要怎么解决 :13::13::13::13::13::13::13::13:

不要在 子类的方法中 去调用 Sprite::init() 方法,
我也碰到这个问题了reference to ‘cocos2d::Sprite::setDisplayFrameWithAnimationName(std::string const&, int)’

然后 去掉 所有的 继承Sprite的类中的 Sprite::init()方法 就通过了