4

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.

enter image description here getting Active status Google APIs Console. enter image description here step 4:i Selected the API Access pane in the console, and click Create new iOS key.

enter image description here

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. enter image description here

  • http://stackoverflow.com/questions/14007075/google-maps-not-working-on-iphone-simulator – sandy Feb 06 '15 at 09:54
  • i have used this . not getting . please check my steps.@sandhaya –  Feb 06 '15 at 09:56
  • reset once ur simulator and check once ur bundle id is same with which u gave in api creation time must be equal, and otherwise plz generate new api key – sandy Feb 06 '15 at 09:59
  • follow this step by step ..http://vikrambahl.com/google-maps-ios-xcode-storyboards/ ..it works for me – Radhey Feb 06 '15 at 10:03
  • have you check my question .when i am seting the bundle id . i have taken screen shot .and i printed it in nslog both are same . –  Feb 06 '15 at 10:05
  • ya r u using same bundle id in project? – sandy Feb 06 '15 at 10:07
  • i used same step @Jigs –  Feb 06 '15 at 10:08
  • yes @sandhaya com.example.Gmap.see –  Feb 06 '15 at 10:09
  • Why are trying to use `Google Maps SDK for Work iOS` (business) or `Google Maps SDK for iOS`? You are using `#import ` but you are trying to generate a Key for another SDK (simple IOS) – TonyMkenu Feb 06 '15 at 10:27
  • download this framework https://developers.google.com/maps/documentation/ios/start?hl=BG ... and "Finally, add your API key to your AppDelegate `#import "` – TonyMkenu Feb 06 '15 at 10:31
  • when i am going in this link.its redirect mr same link what is used Google Maps Mobile SDK for Work –  Feb 06 '15 at 10:35
  • try this link.. or try to go (manual).. to `Google Maps SDK for iOS' not for Work https://developers.google.com/maps/documentation/ios/?hl=BG – TonyMkenu Feb 06 '15 at 11:50
  • Your API key may be invalid for your bundle ID – swiftBoy Nov 24 '15 at 20:44

2 Answers2

3

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>

TonyMkenu
  • 7,597
  • 3
  • 27
  • 49
0

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 :)

rameez
  • 374
  • 2
  • 11