this mac can't connect to icloud because of a problem with gmail
Go to System Preferences > Internet Accounts. 

In the left pane, select the Google/GMail account.

Below the left pane, select "-" to delete the account. This won't delete the GMail account or whatever emails may be in it, but will terminate this Mac's ability to communicate with Google/GMail via the Apple Mail.app.

Sign out of iCloud. Wait a bit.

Sign back into iCloud.

Return to System Preferences > Internet Accounts. Select "Google" in the right pane, and re-enable the Google/GMail account on the Mac.