In Genesis 4:12 God told Cain, “When you work the ground, it shall no longer yield to you its strength. You shall be a fugitive and a wanderer on the earth.” But then in verse 17 it says, “When he (Cain) built a city, he called the name of the city after the name of his son, Enoch.” Is this a contradiction?
No. God did not tell Cain that he would be a fugitive and wanderer for the rest of his life, but it appears in greater context to have been a temporary period of punishment for his actions. Since we see that he did in fact build a city and raise a family, it is likely that his wandering was for only a certain period of time.