谷歌地图因iOS原因不明原因而崩溃

时间:2014-12-08 14:54:02

标签: ios objective-c google-maps maps google-maps-sdk-ios

我在我的项目中使用谷歌地图首先我为它做了一个单独的演示,它工作正常然后我在我的实际项目中再次做了相同的步骤,并从那里它保持崩溃并给我以下错误

- [GMSMapView animateToCameraPosition:]:无法识别的选择器发送到实例0x15dbfc00'

以及

ClientParametersRequest失败,剩余2次尝试(0对6)。错误域= com.google.Maps.GMSDASHConnection Code = 101“无法完成操作。(com.google.Maps.GMSDASHConnection错误101。)”

我添加了-ObjC和-all_load也没有发生任何事情也在谷歌API控制台中创建了一个新的应用程序仍然没有发生任何事情并且它一直崩溃

所以如果有人能帮助我,那么请非常感谢

[super viewDidLoad];
self.gMapView.delegate = self;

    GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:1.285
                                                            longitude:103.848
                                                                 zoom:12];
    self.gMapView = [GMSMapView mapWithFrame:CGRectZero camera:camera];
    self.view = self.gMapView;

那是我的应用代表

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

[GMSServices provideAPIKey:@"AIzaSyBPEpHefI5yHqkwWNR0G6omzSOwcKxb5ag"];


UIColor *tintcolor=[UIColor colorWithRed:60.0/255.0 green:0.0/255.0 blue:0.0/255.0 alpha:0.0];
[[UINavigationBar appearance] setBarTintColor:tintcolor];

// 1
[GAI sharedInstance].trackUncaughtExceptions = YES;

// 2
[[GAI sharedInstance].logger setLogLevel:kGAILogLevelVerbose];

// 3
[GAI sharedInstance].dispatchInterval = 20;

// 4
id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-56097385-1"];

// Override point for customization after application launch.
[FBLoginView class];
UIViewController * initViewController;
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
storageManager = [[StorageManager alloc] init];
NSString * value = [storageManager stringFromUserDeafultsUsignKey:STORAGE_KEY_SESSIONID];
NSLog(@"%@", value);
if(value == nil ){
    initViewController = [storyboard instantiateViewControllerWithIdentifier:@"LunchViewController"];
        [self.window setRootViewController:initViewController];
}else{
    initViewController = [storyboard instantiateViewControllerWithIdentifier:@"MainMenuViewController"];
        [self.window setRootViewController:initViewController];
}


return YES;

}

我正在使用1.9 googlemaps sdk并在它之前使用1.8并且是同样的错误,我的目标是iOS 7并通过iphone 7.1和模拟器进行测试

1 个答案:

答案 0 :(得分:0)

我的错误是在项目中添加-ObjC而不是目标