Joshua 8:1

And the LORD said unto Joshua, Fear not, neither be thou dismayed: take all the people of war with thee, and arise, go up to Ai: see, I have given into thy hand the king of Ai, and his people, and his city, and his land:

The promise belongs to Israel's march from Gilgal to the conquest of Ai. It was given after Achan was punished and his sentence had been carried out. By that time wrath had been turned away from Israel and obedience restored. Joshua was commanded to take all the men of war, to gather the fighting men and marshal them, and to arise and go up against Ai again. Divine power was with Israel, with the armies of heaven fighting for them. They soon took the city and put its enemies to flight.