Can't download Xcode after installing Mojave

Installed Mojave. Tried to update Xcode. App Store wanted a password. Nothing I tried worked. Tried to change password. App Store asked for start up password. Entered it. After a long wait I got the login window again with "An unknown error occorred" message. Tried to change password again and experience the same sequence.