Using a SPM dependency inside a capacitor plugin but the overall app is using Cocoapods

I am creating a capacitor plugin that relies on a third party dependency which is only distributed via Swift Package Manager and I keep on getting the module is not found.

Inside the capacitor plugin, I see there is a Package.swift.

In dependencies, I have added
.package(name: "...", url: "...", from: "...")

In targets, I have added
.product(name: "...", package: "...")

I have also tried manually adding this package through xcode (Package Dependencies → add my package) and this doesn’t work either.

I have built my capacitor app as a Cocopods project so I think this is the reason it’s not properly working. My question is, how can I get SPM to work for this specific plugin while all other plugins continue to use Cocoapods?

You can’t, you have to choose between CocoaPods or SPM

If my project is firm on using CocoaPods and the third party dependency is only available on SPM, are there any workarounds or alternatives?

From my Googling I see that both CocoaPods + SPM can be used together, but maybe thats for iOS projects only? Capacitor apps are different - it requires only choosing 1 package manager?

You should be able to add the SPM dependency to your project directly from Xcode to your app, but you said you tried and didn’t work.
But even if that work, you would have to use a local plugin in your project, not a separate Capacitor plugin installable through npm.

hmm ok, thanks for the support!