I am currently working on GoogleMaps APIs and am following this link https://developers.google.com/maps/documentation/ios-sdk/start .I have successfully completed the 4th step and now am facing problem in the next step where i have to import GoogleMaps in App Delegate's .m file. But i m unable to do so. Can anyone tell me why??
-
Have you reopened the project using "project.xcworkspace" after adding cocoapod?... – Sanman Jul 18 '16 at 11:28
-
yes i did reopen the project. – pri Jul 18 '16 at 11:29
-
You have to import the folder name in pods folder. Try import GoogleMaps. Also You will have to add GoogleMaps.bundle to your bundle. – Sreedeepkesav M S Jul 18 '16 at 12:11
-
can you explain in detail please!! – pri Jul 18 '16 at 12:18
-
In Build Phases -> Copy Bundle Resources -> Add GoogleMaps.bundle and try. – Sreedeepkesav M S Jul 18 '16 at 12:42
3 Answers
Sometimes there is the issue with pods. Make sure you have completely installed googleMaps pod. Please try to build application before import. It solved problem for me.

- 34
- 1
- 4
you are in the correct way , just add the following code
@import GoogleMaps; in your header file or use like #import <GoogleMaps/GoogleMaps.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[GMSServices provideAPIKey:@"xxxxxxx"];
[self.window makeKeyAndVisible];
return YES;
}
While you should be able to start using the Google Maps SDK at this stage, there is one more step you need to take because of a bug in Cocoapods. In the Project Navigator, select the yourPRojectName project at the top. Choose the yourPRojectName target, select the Build Settings tab, and in Other Linker Flags add -ObjC as shown below:

- 82,064
- 23
- 174
- 143
-
the header file "Google" is not showing while importing. Do i have to add in Link Binary in Libraries in Build Phases??? – pri Jul 18 '16 at 11:36
-
-
-
-
see this once http://stackoverflow.com/questions/35451837/cant-get-googlemaps-sdk-to-work-on-xcode-test-target-works-on-app-target – Anbu.Karthik Jul 18 '16 at 11:52
Make sure you installed pod files properly. You can verify it by checking whether all header files are present under "Pods" in "Project navigator" tab at left side.
After that build your app and import
#import "GoogleMaps/GoogleMaps.h"

- 13
- 3
-
All header files are there i have checked sir....but still am unable to import "GoogleMaps/GoogleMaps.h". How is that possible?? – pri Jul 18 '16 at 12:41
-