If your content isn't syncing, consolidate your iTunes Library files and check for issues with third-party security software.
When trying to sync your iPhone, iPad or iPod touch with your computer, you may see an alert message that says:
“The iPhone [device name] cannot be synced. An unknown error occurred (-54).”
This can happen if a file on your computer or on your iOS or iPadOS device is locked. Click OK to continue the sync.
If your content doesn't sync, restart your computer and your iOS or iPadOS device. If you're using iTunes on macOS Mojave or earlier or on a PC, make sure that you have the latest version of iTunes and the latest software updates for your device.
If the issue continues, try one of these solutions.
The media files in the Music app or iTunes library may be stored in several locations. Try consolidating your files into one library.
Some third-party software, including security software, can interfere with the sync process between your computer and your device. Change your security software's setup and see if it fixes the issue.
Only sync a small amount of content at a time. Add more content until you see the error again. By doing this, you'll identify the content that's causing the issue.
If the issue happens with content from the iTunes Store, delete and then re-download the apps and delete and then re-download music. Or download the apps and download music directly to your iPhone, iPad or iPod touch.
If the content isn't from the iTunes Store, delete and then re-import it from the original source.
This issue may happen when you try to transfer iTunes apps purchases or transfer iTunes music purchases from your iOS or iPadOS device to your computer. This may also happen when you try syncing with Apple Books, because it uses the same process. If so, there may be a problem with a PDF file saved to the Books app on your iOS device.
To fix the issue, use the Share option in the Books app on your device to email the PDF to yourself. This will save a copy of the PDF in your email account and will share it with the email address you've chosen, which can be accessed from your computer. Then remove the PDF file from your device.