Apple Mach-O Linker error when using Google Maps SDK for IOS

I am trying to use the Google Maps SDK in my application. So far, I have linked all the structures. I'm sure I've added the appropriate flags -ObjC

as instructed. However, when I copied and pasted my code into my class ViewController.m

, I get the following errors:

Undefined symbols for the i386 architecture:
"_OBJC_CLASS _ $ _ GMSCameraPosition" referenced by: objc-class-ref in FoothillTourViewController.o "_OBJC_CLASS _ $ _ GMSMapView" referenced: objc-class-ref in FoillTourView _OBJCoth_CLASS _ $ _ GMSMarker "referenced: objc-class-ref in FoothillTourViewController.o" _OBJC_CLASS _ $ _ GMSServices "referenced: objc-class-ref in FoothillTourAppDelegate.o ld: Symbol not found for i386 clang architecture: error: linker command failed with exit code 1 (use -v to invoke the call)

"FoothillTourViewController"

is the name of my class ViewController

. Here is the code for my View Controller class. The code is taken directly from the instructions.

#import "FoothillTourViewController.h"
#import <GoogleMaps/GoogleMaps.h>

@implementation FoothillTourViewController {
    GMSMapView *mapView_;
}

// You don't need to modify the default initWithNibName:bundle: method.

  - (void)loadView {
  //Create a GMSCameraPosition that tells the map to display the
  // coordinate -33.86,151.20 at zoom level 6.
  GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86
                                                        longitude:151.20
                                                             zoom:6];
 mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
 mapView_.myLocationEnabled = YES;
 self.view = mapView_;

  // Creates a marker in the center of the map.
  GMSMarker *marker = [[GMSMarker alloc] init];
  marker.position = CLLocationCoordinate2DMake(-33.86, 151.20);
  marker.title = @"Sydney";
  marker.snippet = @"Australia";
  marker.map = mapView_;
  }

      

Any help would be greatly appreciated as I spend hours trying to figure out what is going on. I guess this is a silly mistake, but I can't seem to superimpose on it. Thank!

+2


source to share


3 answers


UPDATE : This answer is out of date. The documentation now tells you to use CocoaPods instead of manually linking dependencies.

See Google Developers Console for more information .

OLD ANSWER:



The Google Maps SDK requires quite a few frameworks to be linked. Here they are:

  • AVFoundation.framework
  • CoreData.framework
  • CoreLocation.framework
  • CoreText.framework
  • GLKit.framework
  • ImageIO.framework
  • Lib ++. Dylib
  • libicucore.dylib
  • libz.dylib
  • OpenGLES.framework
  • QuartzCore.framework
  • SystemConfiguration.framework

I found this list at here .

+6


source


Versions 1.9.2 and earlier of the Google Maps SDK for iOS were available as a zip file containing a static structure. It was also possible to install the latest versions from the CocoaPods module. Starting with version 1.10.0, the Google Maps SDK for iOS is only available for installation through CocoaPods.



+1


source


As you said, you are using the Google Maps SDK for iOS. However, it looks like you are compiling for OS X as the undefined characters for the i386 are Intel processor. (Unless you are trying to compile the simulator)

The SDK cannot be compiled for the simulator. You can check by executing the SDK binary via the "file" command. If it has support for ARM processors but not i386, it has no support for the simulator. You will need to change compile-only build flags for armv7 / armv7s processors.

0


source







All Articles