There's fantasies that incorporate various "{propellant}-powered projectile weapons" but your right that they're not common, though (and maybe not considered "classic" fantasy).
There's also alchemical way to work in guns into a fantasy setting not reliant on gun powder. Or why not have gun powder; alchemy+magic could be a superset of science even.
That's just because they're "more advanced" in Star Wars universe, it has nothing to do with gunpowder avoidance. Isolated societies like Tusken Raiders use firearms and that's clearly depicted as a crude tech, long obsolete in the rest of the galaxy.
I just meant to say that fire-arm style weapons (regardless of propellant or ammunition type) still have a place in fantasy settings
Shields, personal or larger, hamper many projectile weapons in Dune: the projectile has to 'burrow' through the shield.
The modern fibre combat armor is better than gambeson and probably also many forms of plate. It's lighter and can take blades and even polearms better.
Chainmail is in use to protect against industrial equipment.
"Why (High) Fantasy Avoids Gunpowder"