Joshua sacked Ai about 3,200-3,300 years ago (ca. 13th century BCE). After he burned the city to the ground, the prophet claims the city is “forever a heap of ruins.” This is similar to the prophesy about Tyre. They only difference between Ai and Tyre is that Ai no longer exists, whilst Tyre is a major tourist attraction. Anyway, according to Joshua, the city is forever lost to Joshua’s siege.
It comes as a shock, then, when, during the Babylonian Captivity of ca. 500-600 BCE (or around 2,500 years ago), the city is back. A census was taken of the exiles of the captivity showing 123 from Ai.
Apologists might say the city was destroyed, and during the writing of Joshua it was still in ruins, but was rebuilt within the span of 800 years (time from Joshua to the Babylonian Captivity). 800 years or so is a long time, long enough to rebuild a city. Indeed, Joshua probably couldn’t comprehend 800 years when he prophesied that Ai would be lost forever. The only problem with this apology is — like I mentioned — Joshua is a prophet in the Abrahamic religions. A prophet would probably get this right since god was telling him what to say.