Reputation:
I am working a simple iOS app into which I am integrating Google Maps. but not getting any result . i have used this steps
step 1:i have downloaded Google Maps Mobile SDK from this link sdk ios
step 2: Create an API project in the Google APIs Console.
step 3: Select the Services pane in your API project, and enable the Google Maps SDK for iOS. This displays the Google Maps Terms of Service.
getting Active status Google APIs Console. step 4:i Selected the API Access pane in the console, and click Create new iOS key.
and then i added API Key in AppDelegate.m like this
#import "AppDelegate.h"
#import <GoogleMapsM4B/GoogleMaps.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
NSLog(@"Current identifier: %@", [[NSBundle mainBundle] bundleIdentifier]);
[GMSServices provideAPIKey:@"AIzaSTyurcyzpvoRv3gCPJRiw7Dc6dXkTMfOI2w"];
return YES;
}
but i am not getting result. in log i got this error
Gmap[3836:883464] Current identifier: com.example.Gmap
2015-02-06 14:39:41.790 Gmap[3836:883464] Google Maps SDK for iOS (M4B) version: 1.9.13516.0
2015-02-06 14:39:42.014 Gmap[3836:883464] ClientParametersRequest failed, 3 attempts remaining (0 vs 6). Error Domain=com.google.HTTPStatus Code=400 "The operation couldn’t be completed. (com.google.HTTPStatus error 400.)" UserInfo=0x7f922a67fcd0 {data=<CFData 0x7f922d4615a0 [0x1049039a0]>{length = 145, capacity = 256, bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 ... 3c2f48544d4c3e0a}}
2015-02-06 14:39:42.213 Gmap[3836:883464] ClientParametersRequest failed, 2 attempts remaining (0 vs 6). Error Domain=com.google.HTTPStatus Code=400 "The operation couldn’t be completed. (com.google.HTTPStatus error 400.)" UserInfo=0x7f922a4d7540 {data=<CFData 0x7f922d48dd90 [0x1049039a0]>{length = 145, capacity = 256, bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 ... 3c2f48544d4c3e0a}}
2015-02-06 14:39:46.594 Gmap[3836:883464] ClientParametersRequest failed, 1 attempts remaining (0 vs 6). Error Domain=com.google.HTTPStatus Code=400 "The operation couldn’t be completed. (com.google.HTTPStatus error 400.)" UserInfo=0x7f922a6a4a50 {data=<CFData 0x7f922a798c00 [0x1049039a0]>{length = 145, capacity = 256, bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 ... 3c2f48544d4c3e0a}}
2015-02-06 14:39:55.528 Gmap[3836:883464] ClientParametersRequest failed, 0 attempts remaining (0 vs 6). Error Domain=com.google.HTTPStatus Code=400 "The operation couldn’t be completed. (com.google.HTTPStatus error 400.)" UserInfo=0x7f922d49fed0 {data=<CFData 0x7f922a6406e0 [0x1049039a0]>{length = 145, capacity = 256, bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 ... 3c2f48544d4c3e0a}}
2015-02-06 14:39:55.529 Gmap[3836:883464] Google Maps SDK for iOS (M4B) cannot connect or validate APIKey: Error Domain=com.google.HTTPStatus Code=400 "The operation couldn’t be completed. (com.google.HTTPStatus error 400.)" UserInfo=0x7f922d49fed0 {data=<CFData 0x7f922a6406e0 [0x1049039a0]>{length = 145, capacity = 256, bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 ... 3c2f48544d4c3e0a}}
2015-02-06 14:39:55.529 Gmap[3836:883464] Your key may be invalid for your bundle ID: com.example.Gmap
Can someone help to find the mistake here. what is missing here. not able to get why this error is coming .this simulator screen after running apps.
Upvotes: 4
Views: 4625
Reputation: 374
For the GoogleMaps framework you need to install cocoa pods and in then type the following in terminal pod try GoogleMaps
This will install the pod and and download the googlemaps framework. It will
open a sample project on completion. You can find the framework and map bundle in the project. Using this framework my issue was resolved. Below is the complete path of the framework on my machine:
/private/var/folders/9b/w5tw8dwx3vsddqw1g0r1rksr0000gn/T/CocoaPods/Try
Hope this helps :)
Upvotes: 0
Reputation: 7667
As we have already said in the comments, you are using the wrong library - Google Maps SDK for Work iOS
(business) but you are trying to generate a Key for Google Maps SDK for iOS
(you are using: #import <GoogleMapsM4B/GoogleMaps.h>
instead #import <GoogleMaps/GoogleMaps.h>
Upvotes: 3