I can’t compile android with “cocos compile -p android --android-studio”, “cocos compile -p android --android”, “cocos compile -p android”
I have error:
[armeabi-v7a] Compile++ thumb: cocos2djs_shared <= AppDelegate.cpp
[armeabi-v7a] Compile++ arm : cocos2d_js_static <= jsb_cocos2dx_3d_auto.cpp
[armeabi-v7a] Compile++ arm : cocos2d_js_static <= jsb_cocos2dx_extension_auto.cpp
In file included from E:/HocTap/CocosJsWorkspaces/DownloadResources/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/scripting/js-bindings/proj.android/…/auto/jsb_cocos2dx_3d_auto.cpp:1:
In file included from E:/HocTap/CocosJsWorkspaces/DownloadResources/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/3d/…\scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.hpp:5:
E:/HocTap/CocosJsWorkspaces/DownloadResources/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/scripting/js-bindings/proj.android/…/…/…/…/external/spidermonkey/prebuilt/android/…/…/include/android\jsapi.h:12:10: fatal error: ‘mozilla/FloatingPoint.h’ file not found #include “mozilla/FloatingPoint.h”
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from E:/HocTap/CocosJsWorkspaces/DownloadResources/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/scripting/js-bindings/proj.android/…/auto/jsb_cocos2dx_extension_auto.cpp:1:
In file included from E:/HocTap/CocosJsWorkspaces/DownloadResources/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/3d/…\scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.hpp:5:
E:/HocTap/CocosJsWorkspaces/DownloadResources/frameworks/runtime-src/proj.android/app/jni/…/…/…/…/cocos2d-x/cocos/scripting/js-bindings/proj.android/…/…/…/…/external/spidermonkey/prebuilt/android/…/…/include/android\jsapi.h:12:10: fatal error: ‘mozilla/FloatingPoint.h’ file not found #include “mozilla/FloatingPoint.h”
^~~~~~~~~~~~~~~~~~~~~~~~~
I create project with cmd “cocos new DownloadResources -p com.tunt.downloadresources -l js -d E:
\HocTap\CocosJsWorkspaces”
How to install this patch:
1: set env var ANDROID_NDK_ROOT to your ndk-bundle directory
2: right click ndk-wsls-2.0-final/install.bat, run as administrator.
Help, after i upgrade my cocos2dx version there are 2 error in my code.
1 - No match Function in MenuItemImage::create
auto Setting = MenuItemImage::create("res/Setting.png", "res/SettingP.png",
CC_CALLBACK_1(MenuScene::settingFunc, this));
2 - class ‘std::_bind<bool(intro::*)(Touch *, Event *), intro *, const std::Placeholders::_ph<1> &, const std::placeholders::_ph<2>’ is not compatible with class EventlistenerTouchOnebyOne::ccTouchBegan
@slackmoehrle and @bilalmirza, my project dates back a few years, and is now on cocos2d-x 3.16, and I’m not using the storyboard. I am trying to use xassets now, but even when I add a correctly sized iphonex image in the launch images, it starts up smaller.
Ok, this post may be long, so here are the highlights:
I use an older approach, where I have different images (folders) for different size devices
my project is using 3.16
I’m trying to add xassets for the icons and launch images
tried adding an iPhoneX-sized launch image, but my application still comes up with a glview of the size of an iPhone 5
I have code at the top of AppDelegate::applicationDidFinishLaunching()
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
CCLOG("getWinSize width is %f", directory->getWinSize().width);
if (!glview)
{
glview = GLViewImpl::create("PSF");
CCLOG("created glview, %f x %f", glview->getFrameSize().width, glview->getFrameSize().height);
}
BTW, because I created my initial project back when we had to include the iPhone 4 (non-retina), I don’t have the “designResolutionSize” approach, but rather I created separate images for iphone, iphonehd, iphone5 (wider), ipad, and ipadhd, and use redDirOrder.push_back() with folders, and glview->setDesignResolutionSize(width, ht, policy) rather than director->setContentScaleFactor()
Because of that, I don’t know how easy it would be to retrofit whatever the iPhoneX and iphone8 fix is into my project?
Hey, all, I found a partial answer (so far, so good) for getting my 3.16 app to launch on iPhoneX. However, I now need to do a lot of work to get my UI ratios to work, but I think it’s doable.
I’m sharing this here in case it helps anyone else. This is if you’re not using storyboard or xassets. Basically, it uses the naming convention.
well, shoot, I jumped the gun. I was so excited to see my game up in the correct size (and using a new home screen that I created in iPhoneX resolution), that I didn’t notice that the initial screen is the old cocos screen, which baffles me, because I don’t see it anywhere in my project.
I’m going to keep working on it, but I have a question. When I start the simulator, this is the sequence:
show the full cocos screen with gray background (which I never had in this project to the best of my knowledge),
then show a small image of mine, which is usually full screen, so I’m guessing I need to find and resolve that,
finally show my actual home screen.
So … it seems that me providing an image of the right size was enough to trigger iPhoneX, but it’s not using that image!
Yeah, note that my solution is intended for games that don’t want or can’t easily conform to the new interface guidelines for the iPhone X.
e.g. we don’t want the notch to cut off our left-side menu so we used this code to letterbox our game (possibly with tweaks due to issues, but I think it was updated after fixed issues), such that it displays within the safe area insets of the notched device(s).
There’s likely aspects not included, such as requiring launch screen .xib (or correct added default launch images) and other required changes for all iOS apps outside cocos2d changes.