Duplicated Pods files cause build error

Hi, I’m running in to an error when building my ios app in xcode, i get:

duplicate symbols for architecture arm64

I’ve tried to delete the “ios” directory and run ionic capacitor add and open ios again, but I get the same error.

When I look into the ios/App/Pods directory I see that most files are double, also the .podspec files in the capacitor-cordova-ios-plugins folder, so I’m guessing this might have something to do with it.

Unfortunately I have limited understanding of this part of the process, could anyone tell me how I can avoid this duplication?

full error is in CapacitorCordova section:

Ld /Users/m4rinos/Library/Developer/Xcode/DerivedData/App-fiopsdeqlcjxirasuwwsnvxrlxpp/Build/Products/Debug-iphoneos/CapacitorCordova/Cordova.framework/Cordova normal arm64 (in target 'CapacitorCordova' from project 'Pods')
    cd /Users/m4rinos/Library/Mobile\ Documents/com~apple~CloudDocs/Apps/ionic/instill/ios/App/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios11.0 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk -L/Users/m4rinos/Library/Developer/Xcode/DerivedData/App-fiopsdeqlcjxirasuwwsnvxrlxpp/Build/Products/Debug-iphoneos/CapacitorCordova -F/Users/m4rinos/Library/Developer/Xcode/DerivedData/App-fiopsdeqlcjxirasuwwsnvxrlxpp/Build/Products/Debug-iphoneos/CapacitorCordova -filelist /Users/m4rinos/Library/Developer/Xcode/DerivedData/App-fiopsdeqlcjxirasuwwsnvxrlxpp/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/CapacitorCordova.build/Objects-normal/arm64/Cordova.LinkFileList -install_name @rpath/Cordova.framework/Cordova -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/m4rinos/Library/Developer/Xcode/DerivedData/App-fiopsdeqlcjxirasuwwsnvxrlxpp/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/CapacitorCordova.build/Objects-normal/arm64/Cordova_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -framework WebKit -framework Foundation -framework WebKit -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/m4rinos/Library/Developer/Xcode/DerivedData/App-fiopsdeqlcjxirasuwwsnvxrlxpp/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/CapacitorCordova.build/Objects-normal/arm64/Cordova_dependency_info.dat -o /Users/m4rinos/Library/Developer/Xcode/DerivedData/App-fiopsdeqlcjxirasuwwsnvxrlxpp/Build/Products/Debug-iphoneos/CapacitorCordova/Cordova.framework/Cordova