Try doing a Dock restart using the following Terminal command:
killall Dock
Log out/in and test. If that doesn’t work, you need to look in your user Library/Applications Support/Dock for the .db. Use the Finder “Go To Folder” command. Enter ~/Library/Applications Support/Dock. Move the .db to your desktop.
Then try a dock reset.
Applications/Utilities/Terminal enter the command
killall Dock
Log out/in test. If it works okay, delete the .db from the desktop.
If the Dock is the same, return the .db to where you got them from, overwriting the newer ones.
If you prefer to make your user library permanently visible, go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J. When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder. Learned from leonie.