The Android Google Calendar API is not registered on the API console

The following error was encountered while integrating Google Calendar

Please check my code below

Thank you in advance

com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAuthIOException
                                                                        at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential$RequestHandler.intercept(GoogleAccountCredential.java:286)
                                                                        at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:859)
                                                                        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
                                                                        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
                                                                        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
                                                                        at com.taskdemocal.AsyncLoadTasks.doInBackground(AsyncLoadTasks.java:38)
                                                                        at com.taskdemocal.CommonAsyncTask.doInBackground(CommonAsyncTask.java:55)
                                                                        at com.taskdemocal.CommonAsyncTask.doInBackground(CommonAsyncTask.java:33)
                                                                        at android.os.AsyncTask$2.call(AsyncTask.java:292)
                                                                        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
                                                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                        at java.lang.Thread.run(Thread.java:818)
                                                                     Caused by: com.google.android.gms.auth.GoogleAuthException: UNREGISTERED_ON_API_CONSOLE

resolvent:

This error is most likely due to the lack of authorization between your Android application and cloud endpoints API

Since I don't have full access to your actual endpoint API comments and Android code, I suggest you carefully check the following points:

Ensure that you have correctly annotated the cloud endpoints API with ClientID and visitor. The Android audience value is the same as the web client ID. ensure that the updated API has been deployed and the endpoints API source has been regenerated to include it in the Android application. Finally, in your Android source code, you must use googleaccountcredential. Usingaudience (...) Build an instance of googleaccountcredential, and then use this credential object when calling the endpoint API. For example, the endpoint builder will use HTTP transport, gson factory and credentials. Do not leave the last parameter (i.e. credentials) blank

I also received a similar Google authioexception:

com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAuthIOException
at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential$RequestHandler.intercept(GoogleAccountCredential.java:286)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:859)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
at com.example.MainActivity$ListPartiesTask.doInBackground(MainActivity.java:188)
at com.example.MainActivity$ListPartiesTask.doInBackground(MainActivity.java:178)
at android.os.AsyncTask$2.call(AsyncTask.java:287)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:841)
Caused by: com.google.android.gms.auth.GoogleAuthException: UnkNown
at com.google.android.gms.auth.GoogleAuthUtil.zzb(UnkNown Source)
at com.google.android.gms.auth.GoogleAuthUtil.zza(UnkNown Source)
at com.google.android.gms.auth.GoogleAuthUtil.getToken(UnkNown Source)
at com.google.android.gms.auth.GoogleAuthUtil.getToken(UnkNown Source)
at com.google.android.gms.auth.GoogleAuthUtil.getToken(UnkNown Source)
at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.getToken(GoogleAccountCredential.java:255)
at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential$RequestHandler.intercept(GoogleAccountCredential.java:279)
... 12 more

It turns out that I need to create a client ID using the SHA1 fingerprint of the debug version of the application (I have created a client ID for the signed version of the application, but you also need to do so if you haven't already done so)

You can use the following command to obtain the fingerprint (on MAC, the address of debug.keystore may be different on other systems):

 keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

If you need to get the fingerprint of the release key, you can do the following:

keytool -list -v -keystore /PATH/TO/YOUR/release-key.jks -alias RELEASE_KEY_ALIAS

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>