How to add online accounts to Ubuntu

When I attempted to add my Google account to Ubuntu’s Online Accounts tool, the pop-up windows was stuck on Loading “accounts.google.com”.

The solution is to log out of Ubuntu and select Ubuntu on Xorg when logging in again.