UNREGISTERED_ON_API_CONSOLE while getting OAuth2 token on Android

前端 未结 6 2282
礼貌的吻别
礼貌的吻别 2020-11-29 05:56

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\'

6条回答
  •  余生分开走
    2020-11-29 06:32

    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"'.

提交回复
热议问题