Pregunta

I have integrated Google Maps SDK with iOS using Google Developers Console.

But when I run the app now, It gives me following error.

ClientParametersRequest failed, 3 attempts remaining (0 vs 5).

Error Domain=com.google.HTTPStatus Code=400 "The operation couldn’t be completed.(com.google.HTTPStatus error 400.)" UserInfo=0xb83c2a0 {data=<CFData 0xc13d600 [0xe7a4d8]>{length = 145, capacity = 256, bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 ... 3c2f48544d4c3e0a}}

and then it says

Google Maps `SDK` for `iOS` cannot connect or validate APIKey: 
Error Domain=com.google.HTTPStatus Code=400 "The operation couldn’t be completed. 
(com.google.HTTPStatus error 400.)" UserInfo=0x94bf990 {data=<CFData 0x907df90 [0xe7a4d8]>
{length = 145, capacity = 256, bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 ... 3c2f48544d4c3e0a}}

I had requested for the key and I am using the same 40 characters key. I have also tried regenerating the key and then use it. I have searched on net, some people say that "google SDK for iOS" should be enabled in "services". That is also enabled in my case.

But nothing works. Has someone seen the same problem?

¿Fue útil?

Solución

My bundle was incorrect. I changed the bundle at Google Maps Console, and then, generate a new key.

Otros consejos

You just need to verify if your key is correct and if your bundle identifier is correct in the google api manager ... for this you can check your bundle identifier easily putting this line in some initial viewController viewDidLoad ..

NSLog(@"Current identifier: %@", [[NSBundle mainBundle] bundleIdentifier]);

If everything is okay, and your issue continues, just wait ... the key takes about 1 to 2 hours to get up, and forget that thing about google email you when the key is enabled .. they just don't do it!

I have faced the same issue with the API KEY, until I realize that I have used unnecessary brackets in the API KEY initialization. Be sure to write something like:

[GMSServices provideAPIKey:@"XXXXXX"];

instead of:

[GMSServices provideAPIKey:@"{XXXXXX}"];

Cause of issue :

Cause 1: May be bundle id of google console and your application is not matching .(application bundle id and google console bundle id should be same).

Solution : Steps a: GoTo google console and login with your application google account .

for finding key :: open google console > select your project > API & Auth > Credential

b: change bundle id and regenerate key .

c: replace previous key with your new generated key . [GMSServices provideAPIKey:@"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"];

Cause 2: May be key is not matching with you google console key .

Solution: Just replace your application key with google console key . [GMSServices provideAPIKey:@"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"];

Note: Make sure your application bundle id and google console bundle id is same .

For future googlers- like many have mentioned this could be attributed to the bundle id, in my case, even though the bundle identifier on iTunes Connect matched the one on google console, my actual app had a different identifier in XCode under General/Identity/Bundle Identifier, the id has to be consistent in Xcode, iTunes Connect, Member Center, Google Console and Xcode.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top