The official website for The Settlers of Catan

Question about “Traders & Barbarians” Expansion Barbarian Attack - May I resolve the phases “Move your knights” and “Expel the barbarians” in any order, perhaps also simultaneously?

Answer

No. First you have to move all knights, then all the battles take place.