Migration from Cocoapods to Swift Package Manager (SPM) - i have a problem with firebase messaging

I migrated from CocoaPods to SPM, but I’m having an issue with a package that I used to add manually:

target 'App' do
  capacitor_pods
  # Add your Pods here
  pod 'Firebase/Messaging', '11.0.0' # eg 6.31.0 
end

target 'ImageNotification' do
  pod 'Firebase/Messaging', '11.0.0' # eg 6.31.0 
end

This plugin is not added to the list of packages in SPM, and if I add it manually, npx cap sync overwrites it.

How is this usually handled in these cases?

i get the error FirebaseMessaging.h file not found