0
votes

I have tried to integrate Gmail Api in my android app using the follwing tutorial https://developers.google.com/gmail/api/quickstart/android#step_5_setup_the_sample

I followed every steps , but when i tried to test gmail api

The following error occurred:

  403 Forbidden
  {
   "code" : 403,
   "errors" : [ {
   "domain" : "usageLimits",
   "message" : "Access Not Configured. Gmail API has not been used in project 608941808256 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/gmail/overview?project=608941808256 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
   "reason" : "accessNotConfigured",
   "extendedHelp" : "https://console.developers.google.com/apis/api/gmail/overview?project=608941808256"
   } ],
   "message" : "Access Not Configured. Gmail API has not been used in project 608941808256 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/gmail/overview?project=608941808256 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
   } 

I have enabled Gmail Api and Google plus Api too . still the problem exist

Edit : My developer console page

2
Gmail API isn't configured for that project. Check again Google doesn't lie :)DaImTo
Hi Dalm To , Thank you for your reply. please see my edit section where i attached image link of my developer console page .(in that i enabled Gmail api ) If i'm wrong please guide me how to configure Gmail ApiSridhar S
Looks good now double check the project number 608941808256DaImTo
608941808256 is the default project number. and i don't set any project number . Google troubleshoot info for 608941808256 : When the OAuth dialog contains an entry that reads "Unregistered Android application" it means that the OAuth2 client ID you created in Step 2 cannot be found and Android is falling back to a default client. The default client won't be configured to use this API, so requests will fail with errors like accessNotConfigured or mention the default project number 608941808256.Sridhar S
I think i found what mistake i have made , The SHA1 KEY I provided in the developer console is the signed version of my app , which is not placed in play store yet I changed the SHA1 Key to debug version of the app and it workedSridhar S

2 Answers

0
votes

I think i found what mistake i have made , The SHA1 KEY I provided in the developer console is the signed version of my app , which is not placed in play store yet I changed the SHA1 Key to debug version of the app and it worked

0
votes

I registered the SHA1 key for the androiddebug (debug.keystore) and the key for the signed-release version (your own keystore) creating two OAuth 2.0 client IDs. This allowed me to test my app. Remember that sometimes the changes take a few hours to be reflected.