Xcode build error: 'ld: unknown option: -platform_version'

I get this build error when update Xcode to 11.4, and the project runs well in Xcode 11.3.

I have no idea what wrong and how to fix it.

By the way, I use both Cocoapods and SPM.

please give me some suggests.

Replies

Did you do the usual option-clean build folder.

And eventually, deleted derived data ?

YES, I tried clean build folder and restart Xcode or my Macbook.

I even reinstall Xcode , but the error still happen.

Do you get the problem when you create a new project, with or without Cocoapods and SPM ?


Could you try:

- new wproject without Cocoapods and SPM

- new project with Cocoapods alone

- new project with SPM alone

- new project with Cocoapods and SPM

Thank you for you advice.

I create some new projects as you suggest and have no problem.

I'll keep searching on it.

No problem even with pods and SPM ?


So problem is somewhere in your project.


Did you delete derived data ?

Delete derived data is not working

Remove SPM is not working

Maybe there is some problems with my project