Cocos2d-x V4.0 released

@coulsonwang may be able to take a look for us.

@TommiGustafsson you are right, we forgot to remove it in template. We will send a PR to fix it. Thanks.

fixed in cocos2d-x/pull#20463 and bindings-generator/pull#253.

If anyone’s wondering what’s the “correct” way to check the “Requires full screen” on an ios project when using cmake:

You must edit proj.ios_mac/ios/Info.plist
Add UIRequiresFullScreen as a bool set to true.

edit: btw, does anyone know the correct way to set the icons for an ios app so it can be uploaded to the app store/testflight? Right now I’m just using the default icon cmake configuration. I can see the cocos icon on my app, both in xcode ios project and when compiled on a device. However when trying to upload I’m getting the following errors:

App Store Connect Operation Error
ERROR ITMS-90032: “Invalid Image Path - No image found at the path referenced under key ‘CFBundleIconFile’: ‘Icon-57.png’”

App Store Connect Operation Error
ERROR ITMS-90704: "Missing App Icon. An app icon measuring 1024 by 1024 pixels in PNG format must be included in the Asset Catalog of apps built for iOS, iPadOS, or watchOS. Without this icon, apps cannot be submitted for review. For details, see https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/app-icon/."

Regarding the first error there’s an Icon-57.png in proj.ios_mac/ios/Images.xcassets/AppIcon.appiconset. so not sure where it’s looking for the icon.

Second error makes more sense since I can’t seem to find a 1024x1024 icon anywhere.

Obviously I want to set all this from cmake (if possible) or in a “cmake compatible” way so it can be shared with everyone on my team.

edit2: Ok, solved both issues.
For the first issue I deleted the “icon” entry in Info.plist. For the second issue I just created a 1024x1024 icon and added it to Images.xcassets in xcode.

1 Like

Is anyone using tile maps with v4?
I have some weird rendering issues which I will try to investigate today. They only seem to happen on windows. Mac and ios builds are fine.

edit: the issue is related with carriage returns under windows being /r/n. I have fixed the bug. Hopefully tomorrow when I’m less tired I’ll make a PR explaining in full detail.

edit2: I have fixed the problem and made a PR which you can see here https://github.com/cocos2d/cocos2d-x/pull/20483

@zhangxm

since v4 remove h5 engine and JSB, how do we upgrade from cocos2dx-js v3.17.2 to v4?

Thanks!

@Zinitter this is the time to move to Cocos Creator.

Thanks for the reply.

Does Cocos Creator V2.3.2 already support metal?
And is there any guide to covert from cocos2dx v3.17.2 source and prebuilt lib to Cocos Creator?

I need to defer to @zhangxm about when Creator will support Metal. I know there is a lot of work happening.

I don’t know of a guide that specifically demonstrates converting cocos2d-js to Creator. Let me ask the Creator team for their thoughts on making the migration. AFAIK, it is a rewrite.

There is warning in Xcode 11.4
GLKit and OpenGLES is deprecated. Consider migrating to MetalkKit instead

If Cocos Creator do not support Metal, there is no point to migrate.

But then it will be a big issue because who using cocos2d-js have no any option to adopt metal as v4 removed h5 and jsb.

looking forward the migration method and thanks for the help!

We are in a hard spot because Cocos2d-js hasn’t been updated since around the 3.13 days, IIRC. I know it says 3.17 in the API Ref but it hasn’t been updated functionally in quite a while.

There is no upgrade path for Cocos2d-js users to v4.

so best hope is convert to Cocos Creator project with some api adaptation?

Indeed that is the best way. Although the API isn’t identical.

at least Cocos Creator is in javascript and hope to adopt metal.
option to adapt is much better than door closed permanently.

really looking forward to the guide on transition from cocos2d-js to cocos creator.

i remember there are some issue on
ScriptingCore::getInstance()->evalString(string);
for javascript <-> native iOS function calling

had a look on the new Cocos Creator, it looks similar to the old time Cocos.

I have started a Cocos2d-x V4.0 tutorial series, links can be found here Cocos2d-x v4 Tutorial Series - Sonar Systems

1 Like

While using V4.0 on Xcode 11.4, I run the project on a real device works fine, static libs are being generated and placed in ios-build/lib/debug, if I switch over to a simulator device I get some linking errors because it’s the wrong arch. Looks like the libs did not get updated. Anyone else getting this issue? If I delete whats in ios-build/lib/debug then run simulator it works. I tried with hello world app and it’s happening.

ld: warning: ignoring file /Users/ericbouchard/Documents/cocos2d-x/ios-build/lib/Debug/libcocos2d.a, building for iOS Simulator-x86_64 but attempting to link with file built for iOS-arm64

Then a bunch of linking errors.

1 Like

@ericb365 ave you tried switching “build only active architectures” in build settings to “no” for all targets?

1 Like

I tried that but it did not fix the issue. I tried another v4 project I have and I don’t have the same issue. I integrated some sdkbox plugins in this new project, maybe some problems with my CmakeList.txt file

1 Like

Does anyone know how to add a “Run Script Phase” configuration to xcode using cmake?
Basically I want to run a script before building from xcode, but since we are using cmake I must do this from cmake as to not lose it each time the project is generated.

Congrats and Thank You Team