Link errors when archiving iOS?

My game builds ok, but when I try to archive I get 100 link errors like:
“typeinfo for cocos2d::Layer”, referenced from:
typeinfo for GameLayer in GameLayer.o
typeinfo for UILayer in UILayer.o"

What am I missing?

iOS compiled with XCode. It builds ok in the simulator, but not when trying to build the final archive. Project is missing something but I’m not sure what

Hi, I Think had this problem, what Version of OSX you’re running. I Think I started getting this problem when I upgraded past High Sierra. Before that change the security stuff on Mac, I even had problems trying to install things Like “Brew”. My MacBook is still setup to run cocos V3.17.2 on High Sierra CPU is Intel I7 7770, compiling command line and in Xcode was the last one they allowed on the last version of High Sierra.
After that it would compile but not run, same problem ran found out the simulator was lying.
I got fed up with trying to fix IOS problems I spent a week tying to finger it out worked great then deploy on hardware and crash did not even start, because of the SIM on IOS not working the same as hardware gave me false results, It was my fault somehow I knocked the “return true” statement off the INIT() of helloworld.cpp, But the SIM should’ve picked this up. The only advice I can give try to make a new project deploy on Hardware and cut copy past your bits of project till error.

//You could also try to add to header
using namespace cocos2d;
using namespace cocos2d::ui;
using namespace cocos2d::Layer;

it has been about 5 months I move to windows because mac was forcing me to upgrade all the time and had to keep downgrading. M1 chips are now ARM I have not been near that, but I’m seeing problems on the forum for it so scout around it, you’re not the only one.
Sorry I’m unable to help much, but best advice try to keep deploying to Hardware to test a lot and not SIM. I know it’s a nuisance, but found I ended spending more up fixing things that did not need fixing. Hope you can get it fixed.

1 Like

It appears I had to change the basesdk for all the targets in the project from iphonesimulator to ios - I will definitely do some device testing though. Thanks!

That’s Awesum news, Thanks for the share.

One last tip,

Watch the audio if you’re using it. It’s works on hardware but not in SIM prepare for shock I can assure you both SimpleAudio and play2p play everything floorless, but only on Device, found that one out a week later when I acc decadently compiled to device and there was noting wrong, Yeah man a week.