Can't sync my iTunes library to my iPhone?

So I'm using an iPhone 4s with IOS 7.0.4 and am trying to sync it via USB to iTunes 11.1.3 on my iMac which is currently running Maverick. It syncs everything but my music. It goes through the entire syncing process but upon reaching step 7 out of 7 it gives me the message.

"The iPhone can't be synced because it can't be read from or written to"

It originally had all my old music and just wouldn't take any new music so I decided to reset my phone. Well, now there's no music and it still will not sync my music.

Can anyone help me out? It is extremely frustrating not to have any music. It's really difficult to go on a 40 minute run by myself without music. Running is boring as s***t with nothing to do!

Try unlocking your iPhone while syncing, mine used to do this. Sometimes iTunes believes you're syncing a memory card, and it thinks it's in the 'locked' position. Try keeping the phone unlocked and then syncing. See what happens and get back here if it doesn't.

  • Why won't my iphone 4 sync with my itunes library? For some reason it does not work. I tried automatically syncing it and manually, but I can only get the songs if it is in a playlist. I want to be able to see all of the songs by artist though and the new songs are not under there. Also, some of the artists have spelling errors which I fixed on my itunes library, but which won't come up in my iphone. Really annoying. It used to be I just plugged in my ipod and everything synced with the itunes library.
  • Why does iTunes need internet access to sync music CDs onto my library? I noticed my internet went out and while syncing music cd's I noticed it didn't show the track names without internet out of curiosity I'm wondering why it needs access to syncing cd's onto my iTunes?
  • Why do songs get deleted from my iphone when i sync it to my itunes library? Everytime i sync my iphone (5) to my itunes library, all the songs i had just recently bought on my iphone get deleted and if i try to re-purchase it on itunes it just says "purchased." Somtimes i will even try to re-purchase it from my laptop and even though the purchased song it in my library, it doesn't transfer to my iphone.
  • IPhone 5 won't sync to iTunes library? So I just got the iphone 5c and when I try to sync iTunes library to transfer my music, it's still gray. Also, every time i connect my phone to my computer iTunes recognizes it as a new phone and asks me everytime if I want to restore settings or use as new iphone. I must've restored at least 5 times and still can't sync. I beginning to think it might be the library and not the phone.