Build failed for Mac using latest XCode 12.3

Yes, that also i did. But i changed to 10.11, dont know its side effects.

@smitpatel88 were you able to generate cocos precompiled libs for arm64 (zlib, png, jpeg, etc)? otherwise compilation will fail for all valid archs which is the default for Release.

@kmaker I had not tried to make release build yet. Are you talking about Mac only?

I dont think Cocos team is concern about their old users anymore.
You guys are just concentrating on Creator, this is really bad.

1 Like

We haven’t forgotten about any users. I know the team is neck deep in work combining 2D and 3D, new platform support and working to combine the engines. This work will benefit Cocos2d-x and Creator users. While I don’t know every single detail I do know they are working hard and lots of extra hours.

Does this help: Apple M1 xcode build fails - #15 by zhangxm

@smitpatel88 Yes, Release compilation on Mac with Xcode 12.3.
@slackmoehrle I think that’s a solution for Creator. What we need here are all cocos2d c++ precompiled libs with the new arm64 architecture for macOS (regardless the cocos2d c++ version).
Even though there are workarounds (e.g., use an older Xcode or disable arm64 arch), keep in mind that they won’t work if you have a mac with M1 chip.

It’s not a solution for creator. It’s a PR for cocos2d-x.

@slackmoehrle Unfortunately that PR does not help.
Just in case the issue I’m seeing is not clear: on mac version of prebuilt cocos2d-x 3rd party libraries (the ones generated with GitHub - cocos2d/cocos2d-x-3rd-party-libs-src: Dependencies of cocos2d-x., like cocos2d/external/png/prebuilt/mac/libpng.a) the architecture arm64 is missing. You can tell this by running the command “lipo -info path-to-lib”.

I downloaded that code and played a little bit with it. I was able to generate zlib for arm64 but have problems with some of the others.

Now we have 4 old projects and we are developing 1 project with the cocos2d-x CPP , so I am worried about we are abandoned :anguished: :anguished: :anguished:

1 Like

You mean a merge between cocos2d-x v4 and cocos2d-x-lite (the one used by Creator on native deployments)? I’m 100% on board if that’s the case!

True. That’s the plan.

1 Like

Is there a roadmap or a release date in sight?

1 Like

Not yet. Once Creator v3 is out we will have a better plan.

Hello @slackmoehrle ,
Creator v3 is now out. Do you have a roadmap you could share? Will it be a v3.18?
We have a few projects that depend fully on cocos so the information would be extremely welcome.
Best regards,

We don’t have any plans to release v3.18 at this time. Make sure you are using the latest from GitHub to stay up to date on fixes.

@smitpatel88 @slackmoehrle were you able to find a fix? I don’t have the option to downgrade.

Hi @bilalmirza
This is what i do for Mac

  1. Goto /Project/cocos2d/cocos/audio/mac/CDAudioManager.m Comment line no 408 & 409
//        AVAudioSession* session = [AVAudioSession sharedInstance];
//        session.delegate = self;
  1. Add this line below it at line no 410
[[AVAudioSession sharedInstance] setActive:YES error:nil];
  1. In same file CDAudioManager.m comment line no 328 & 329
 //    UInt32 varSize = sizeof(isPlaying);
//    AudioSessionGetProperty (kAudioSessionProperty_OtherAudioIsPlaying, &varSize, &isPlaying);
  1. Add this line below it at line no 330
isPlaying = [[AVAudioSession sharedInstance] isOtherAudioPlaying]; 
  1. In same file CDAudioManager.m goto line no 485 in isDeviceMuted
    replace below code
 -(BOOL) isDeviceMuted {

	#if TARGET_IPHONE_SIMULATOR
	    //Calling audio route stuff on the simulator causes problems
	    return NO;
	#else
	    return NO;
	#endif
	}
  1. Goto /Project/cocos2d/cocos/audio/mac/CDXMacOSXSupport.h
    Comment line no from 43 to 46
	 //enum AudioSessionProperties {
	//	kAudioSessionProperty_OtherAudioIsPlaying,
	//	kAudioSessionProperty_AudioRoute
	//};
  1. /Project/cocos2d/external/bullet/include/bullet/LinearMath/btVector3.h
    replace below line at 42
    Old line :
    #define BT_SHUFFLE(x,y,z,w) ((w)<<6 | (z)<<4 | (y)<<2 | (x))
    with new one:
    #define BT_SHUFFLE(x, y, z, w) (((w) << 6 | (z) << 4 | (y) << 2 | (x)) & 0xff)

  2. macOS Deployment target increase to 10.11
    For main project as well as for libcocos2dMac

  3. If required do clean project and run

I hope this help you.

5 Likes

@smitpatel88 Thanks, This works great! :smiley:

Thanks @smitpatel88, I’m going to give this a try. I can now build and run the Mac version in xcode 11, but if this works, it would be great to run in xcode 12.4.

I have a dumb question. I’ve been using the same project for several years, just updating the code, and I just noticed on the right side that I have “Project Format” set to “Xcode 3.2-compatible” and I see there are much later options. Do you know anything about that option and whether it matters?

I’d probably be smart to create a new project in January and pull my C++ code into it, but I’m not even sure how to start that, to be honest.

Thanks again!