Can't add music to iPhone anymore I have seen this: Greyed out songs when trying to add from itunes to iphone? but though the issues are similar, I think my version has a different cause. Anyways, none of the answers there did work for me.

When I try to add an album to my iPhone, it does not synchronise the album. I think this is the case because:


When I click "Synchronise", it only takes a split second. This is strange, since the album is a little over 100 MB in size (according to iTunes itself).
The album does not appear on my iPhone
They do appear in iTunes->iPhone->On My iPhone, but greyed out, with a dotted circle to the left of the tracks.


What I did first was (as I have always done and never had problems with) just select the album from iTunes->iPhone->Music (with "Sync Music" and "Sync only selected items" checked), but this gave the result described above. I then tried to do it manually (after checking the "manage music and videos manually" option in the summary) but this gave the same result. I even tried another album, which doesn't work as well. Both albums come from CDs and do play normally in iTunes. (In fact, I'm listening to one right now.)

I do not mind deleting all songs from my iPhone, since restoring that wouldn't take long, even manually (it's just one album right now), but future visitors might benefit more from your answer if it didn't require that.

What I think to be the cause:
I reinstalled the operating system on the computer with iTunes a while ago (see my previous questions for more info) and didn't want to restore from the Time Machine backup, since I had accumulated a lot of superfluous bytes, and the reinstallation seemed like a good opportunity to get rid of those. I restored my iTunes library by simply restoring only the ~/Music directory, which restored all my songs. But when I connected my iPhone to my computer it asked me if I trusted the iPhone (and the iPhone asked if I trusted the computer). I think my manual restoration of iTunes didn't include some files connected to managing devices with iTunes which causes this now.
There could be several reasons for this as far as I can tell, but my solution, after hours of research was rebuilding the iTunes library.

You might be able to check if this will actually work by addig some new music to your library and then trying to sync it to your device.

If becomes available (black instead of gray in the Music section), then this might work for you.

The steps for rebuilding your library are pretty simple, described here: https://support.apple.com/en-us/HT201561

Basically: 


Close iTunes
Go to your iTunes Music folder
Move the itunes library xml to a different location (e.g. desktop)
Delete the .itl file (the actual library information)
Reopen iTunes and import the moved xml (Import Playlist)