Cocos2d-x V4.0 released

I’m created exactly as you write. Every run on device is fine, only archive is broken (just open archive and locate Products folder - it will be empty).

You are right, the file is empty. I didn’t notice, i just thought the file can not be generated.

The fix is simple, as i’m write above.

Yep, but we should set it in CMakeLists.txt. You can add this line in CMakeLists.txt:

set_xcode_property(${APP_NAME} INSTALL_PATH "\$(LOCAL_APPS_DIR)")

@hexerror I sent PR to fix it: https://github.com/cocos2d/cocos2d-x/pull/20402. But i don’t know if it works for macOS applications, i don’t have the development account for macOS.

I can test this too @zhangxm

@slackmoehrle thanks.

@solan I fix it in PR 20403. Could you help to check if the PR works for you.

@coulsonwang I checked and it seems that my case is processed properly now, thanks.

@zhangxm

iOS works

cocos new v4-test-1 -l cpp -d .
cd v4-test-1/
mkdir ios-build
cd ios-build
cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS

but trying too compile for macOS seems to fail. I think I’m using a bad cmake command.
Referenced per these docs: https://docs.cocos2d-x.org/cocos2d-x/v4/en/installation/OSX.html

cocos new v4-test-2 -l cpp -d .
cd v4-test-2/
mkdir mac-build
cd mac-build
cmake .. -GXcode

error:

 cmake .. -GXcode
System is unknown to cmake, create:
Platform/mac to use this system, please send your config file to cmake@www.cmake.org so it can be added to cmake
Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. Please send that file to cmake@www.cmake.org.

@slackmoehrle i don’t find any issue with macOS. What’s your cmake version? And are you sure you use v4’s console?

@zhangxm

$ cocos -v

Python 2.7.10
cocos2d-x-4.0
Cocos Console 2.3
$ cmake --version
cmake version 3.15.5

CMake suite maintained and supported by Kitware (kitware.com/cmake).

@zhangxm @slackmoehrle when will the v3 next release?

We plan to start testing next week. And it may take about 2-3 weeks to release it.

1 Like

@zhangxm do you see anything wrong with my setup above?

It seems no problem about the environment. Can you run which cocos to check the cocos path?

It’s in my v4 path. Weird. I’ll start over and log each step and post it.

@zhangxm still no luck

$ git branch -v
  v3 a96ff32987 Fix isVariable method buffer overflow. (#20376)
* v4 ff333f7c0a update error link

$ which cocos
/Users/jason/icloud/Cocos/Cocos2d-x/cocos2d-x/tools/cocos2d-console/bin/cocos

$ cocos -version
Python 2.7.10
cocos2d-x-4.0
Cocos Console 2.3

macOS 10.14.6
Xcode 11.1

I can try upgrading to Xcode 11.2.1 or 11.3 and see if I’m still struggling.

It is wired, and i think it is nothing about Xcode. It is something about CMake. The CMake file doesn’t use SYSTEM on macOS, and i can not reproduce the issue. My macOS is 10.14 too, CMake 3.15.3.

i’m not sure is this related, you can try check mac terminal is bash or zsh as Apple change new terminal to zsh.

But setup.py does not update to check and update .zsh for the path

1 Like