We\'re under Android (Jellybean and higher), and we\'ve got an app which need to use OAuth2 with Google for authentication.
I simplified the login activity, but it\'
Don't have the reputation to comment on the accepted answer...
Registering my app in the google dev console wasn't working for me. It turned out that since I was using the debug gradle build, I had to append ".debug" to the package name in google dev console.
I found this out by debugging the Android AccountManager code. When I stepped into the code, I noticed the variable for my app's package name had ".debug" at the end of it. So instead of using the actual package name "com.package.name" in the google dev console, I changed it to "com.package.name.debug" which fixed the UNREGISTERED_ON_API_CONSOLE exception for me.
The reason for this is because my debug buildType in gradle had 'applicationIdSuffix ".debug"'.