Search code examples
iosgoogle-mapsiphone-5

GoogleMap SDK 1.3.1 Linker command failed with exit code 1 error when build on iPhone 5


I'm implementing an app that using Google Map feature, everything is ok on Simulator and my iPhone 4 device, but when I try to build app on iPhone 5, I got an Linker command failed issue.

The attach file is what I set on my Build Setting.

Does anyone get this problem ? I'm stuck with it for almost 1 week >"< .

Here my code in file.h

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MapKit.h>
#import "MyViewController.h"
#import "MyAnnotation.h"
#import <GoogleMaps/GoogleMaps.h>

@interface PaymentViewController : MyViewController <CLLocationManagerDelegate, GMSMapViewDelegate> {
    MKMapView *mapView;
    CLLocationManager *myLocationManager;
    CLLocation *myLocation;
    MyAnnotation *annotation;
    GMSMapView *myGoogleMapView;
}

@property (nonatomic, retain) MKMapView *mapView;
@property (nonatomic, retain) CLLocationManager *myLocationManager;
@property (nonatomic, retain) MyAnnotation *annotation;
@property (nonatomic, retain) GMSMapView *myGoogleMapView;
@property (nonatomic, retain) CLLocation *myLocation;
@end

and here is file.m

#import "PaymentViewController.h"

@interface PaymentViewController ()

@end

@implementation PaymentViewController
@synthesize mapView, myLocationManager, annotation, myGoogleMapView, myLocation;


-(void)loadView{
    [super loadView];
    self.title =@"Input Payment";


    /*--------- create google map view --------*/
    myGoogleMapView = [[GMSMapView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height/3)];
    myGoogleMapView.myLocationEnabled = YES;
    //myGoogleMapView.settings.myLocationButton = YES;
    myGoogleMapView.mapType = kGMSTypeNormal;
    [self.view addSubview:myGoogleMapView];

}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    //this will register the KVO (Key Value Obversing) for key myLocation
    [self.myGoogleMapView addObserver:self forKeyPath:@"myLocation" options:NSKeyValueObservingOptionNew context: nil];
}


- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{

    //this will check the key that we register before and excute the code inside this function

    if ([keyPath isEqualToString:@"myLocation"] && [object isKindOfClass:[GMSMapView class]])
    {
        GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:self.myGoogleMapView.myLocation.coordinate.latitude longitude:self.myGoogleMapView.myLocation.coordinate.longitude
                                                                     zoom:17
                                     ];
        self.myGoogleMapView.camera = camera;

//        [self.myGoogleMapView animateToCameraPosition:[GMSCameraPosition
//                                    cameraWithLatitude:self.myGoogleMapView.myLocation.coordinate.latitude
//                                    longitude:self.myGoogleMapView.myLocation.coordinate.longitude
//                                    zoom:16]];
    }
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];

    [self.myGoogleMapView removeObserver:self forKeyPath:@"myLocation"];
}
@end

Thank you so much!

https://i.sstatic.net/5UrhG.png

https://i.sstatic.net/D0Q6w.png


Solution

  • This helped me solve this problem. http://www.galloway.me.uk/2012/09/hacking-up-an-armv7s-library/

    For whom may needed.