But the mountain shall be thine; for it is a wood, and thou shalt cut it down: and the outgoings of it shall be thine: for thou shalt drive out the Canaanites, though they have iron chariots, and though they be strong.- Joshua 17:18
And the LORD was with Judah; and he drave out the inhabitants of the mountain; but could not drive out the inhabitants of the valley, because they had chariots of iron.- Judges 1:19
It's been argued by skeptics that the above verses are contradictory because God promises to empower the Israelites to successfully drive out the Canaanites. Yet, God Himself wasn't able to drive out the inhabitants of the lowlands because they had iron chariots.
1. God promised to drive out the Canaanites slowly.
29 I will not drive them out from before thee in one year; lest the land become desolate, and the beast of the field multiply against thee. 30 By little and little I will drive them out from before thee, until thou be increased, and inherit the land.- Exo. 23:29-302. The "he" in Judges 1:19 is Judah, not God. It was Judah who wasn't able to drive out the inhabitants, not God. Modern translations make that clear. Anyone who has read the Bible knows that tribes and people groups were sometimes spoken of as if they were one person. Even being called "he," "him," or "his" (etc.). That's because the progenitor or leader of a group both represents the group, along with the group being associated with the progenitor or leader.
3. God didn't promise that the Israelites would win every single one of the battles. The winning of battles were partly conditioned on their faithfulness to God (Judges 2:1-3). Even faithfulness didn't guarantee 100% victory. Even back then they had a deep understanding of God's sovereignty and providence. They knew that whatever happened, good or bad, happened by God's permission and decree. Yet at the same time, they knew that some providences are especially indicative of God's attitude of favor and approval or disfavor and disapproval. See, for example, how David reacted to Shimei's curses upon him (2 Sam. 16:5-14). David acknowledged that Shimei cursed him in accordance with God's providence.
4. Being "with" or "on the side" of someone has degrees. For example, Jerry can tell George that he's with George in his plan to lose 30 pounds and run a scheduled marathon a year from now. Jerry's support can range from weekly or daily phone calls of encouragement to daily waking up George at the crack of dawn and helping him train. Even spending hundreds of dollars in equipment to help George be ready for the marathon. Depending on Israel's faithfulness, God could be with the Israelites.
5. God works by 1. ordinary providence, 2. special providence and 3. extraordinary providence (see my definitions and explanations HERE). God being with someone doesn't entail that they can do anything at any time. God may be with Elaine but that doesn't necessarily mean that Elaine, as a five foot three inches woman, can dunk a basketball. By God's ordinary providence Elaine probably won't be able to dunk a basketball. However, by God's special or extraordinary providence Elaine would be able to dunk a basketball.
Similarly, by God's ordinary providence Judah may not have been able to drive out the inhabitants of the lowlands at that time. But that doesn't mean that they would be not able to do so in the future by God's ordinary providence. Or even in the future by God special or extraordinary providence.
So, this alleged contradiction and theological conundrum is actually pretty vacuous.