“You will not be able to serve Yahweh.” Joshua is not saying the people cannot serve Yahweh. But Joshua is saying that as things are, and especially as time goes on and years and years go by, the people will have a hard time serving Yahweh. As we know, even as Joshua was telling people to serve Yahweh, he was also having to tell them to get rid of their other gods. Joshua also knew the predictions of Moses, that Israel would turn away from Yahweh (Deut. 29:16-28; 32:4-33). So given the present situation and Moses’ statements about Israel’s future, Joshua understood only too well that Israel would not be able to serve only Yahweh as God unless they had a change of heart toward the pagan gods and made an extreme effort to keep themselves pure in the eyes of Yahweh.
“He will not forgive your disobedience.” God forgives sin, but in this context, after the Israelites had ignored God’s holiness and stirred up His jealousy, there would be consequences that could not just be “wished away.” Many times when people sin they can confess their sin and be forgiven on a spiritual level, but the consequences in the physical world still occur. King David is a good example. He confessed his sin to Nathan the prophet who told him his sin was forgiven but the child born of adultery would still die ( 2 Sam. 12:13-14).