Swimming + flying cheap drones doable: https://www.youtube.com/watch?v=FC9EJhs0pc0&ab_channel=Rutge...
At (wild overestimate) $1k per drone an attacker can wield 13 million drones for the equivalent cost of an aircraft carrier, not including ongoing expenses.
Clearing the flight deck with antipersonnel warheads would probably work better, but I wouldn't count on that to keep a carrier out of action for very long. If you really want to sink a ship, either use proper anti-ship warheads or don't bother trying.
But there's no particular reason to expect that this future will be a Mohist one in which peace is ensured because magically cheap defensive drone swarms make every fortress impregnable and thus combatants' home territories always remain unscathed; at least as likely is a Second Variety future in which drone swarms are more effective for attack than for defense, perhaps even after all the human combatants are dead.
Though actually I'm coming around to the idea that a bunch of AI-targeted flak guns are sufficient, and that carriers are probably fine either way due to how close a series of missiles containing the swarm would have to get anyway.
There could be an interim period of many years where very important stuff is very vulnerable.