Scene* BattleScene::createScene()
{
// 'scene' is an autorelease object
auto scene = Scene::create();
// 'layer' is an autorelease object
auto layer = BattleScene::create();
// add layer as a child to scene
scene->addChild(layer);
// return the scene
return scene;
}
same as the one created default, so I don’t think it has any problem.
and yes it is public and static
public:
static cocos2d::Scene* createScene();
I was able to build apk with different command
cocos compile -p android --android-studio --api-abi x86
but when I run it, nothing but black screen
btw the game runs fine on VS.
When compiling without --android-studio tag you are compiling the project inside proj.android, not proj.android-studio. That’s why you were getting that error, because you probably didn’t add your files to the Android.mk inside proj.android.
Thank you for the reply.
I was able to compile without error, but as I try to run it, nothing shows up.
I think I am missing something. I should try to re-set up the environment.
I can’t check it at the moment. I have usb connection problem so I manually move the apk file to the device to install and test. It doesn’t crash, just black screen.
Well in that case I don’t see something obvious that you are missing. You should try resolving your usb connection problem and check your log. Maybe try creating a new project and moving your existing sources and resources there…
I built new project and moved all my codes to there,
checked logcat and found one spelling error which caused libcocos2dx to stop
I will work with new project folder from now on. Thx for all the replies!