Please test after taking each of the steps below that you haven't already tried. Back up all data before making any changes.
1. If you're running any other application that connects to the device, such as (for example) Apple Configurator, quit it.
2. Follow the directions in this support article.
3. If you subscribe to iTunes Match, then on the device select
Settings ▹ iTunes & App Store ▹ iTunes Match: Off
Re-enable iTunes Match if the sync succeeds. (Credit for this solution to ASC member Blue Velvet.)
4. Take this step only if you're running OS X 10.9 ("Mavericks") or later. It moves to the Trash "semaphore" files that have not been cleaned up by the system and may be interfering with normal operation. The files are empty; they contain no data.
Please triple-click anywhere in the line below on this page to select it:
find L*/{Con*/*/Data/L*/,}Pref* -type f -size 0c -name *.plist.??????? -exec mv {} .Trash/ \; 2>&-
Copy the selected text to the Clipboard by pressing the key combination command-C.
Launch the built-in Terminal application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
☞ Open LaunchPad and start typing the name.
Paste into the Terminal window by pressing the key combination command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
Wait for a new line ending in a dollar sign ($) to appear below what you entered.
Log out or restart the computer and empty the Trash.
5. As a last resort, restore the device in recovery mode.