I got the above error after I updated the Xcode to the 14.3 version. I followed this StackOverflow answer to solve that error and it worked for the first time.
https://stackoverflow.com/a/75921492/16529433
But when I build again I have to edit that pod file again. I am using an ionic capacitor to build the IOS app. Is there any way to merge the pod file changes to the ionic source code?