【问题标题】:Google Maps keep crashing for unknow reason iOS谷歌地图不断崩溃,原因不明 iOS
【发布时间】:2014-12-08 14:54:02
【问题描述】:

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

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

还有

ClientParametersRequest 失败,剩余 2 次尝试(0 对 6)。错误 Domain=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 和模拟器对其进行测试

【问题讨论】:

  • 你有 google api 访问令牌/访问密钥吗?
  • @NorthBlast 是的,我有它 AIzaSyBPEpHefI5yHqkwWNR0G6omzSOwcKxb5ag 并且它已经添加到我的应用程序委托中,顺便说一句,我在我的应用程序(如 Facebook)中使用了大量 API 和 SDK,以防你知道这是否会导致这样的错误谢谢
  • 您不应公开发布您的 API 密钥!
  • 您的目标或项目中是否设置了 -ObjC 标志?它应该在项目的构建设置中。
  • @Kerni 仅用于测试没关系,但非常感谢您的建议

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


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2017-10-28
    • 1970-01-01
    • 1970-01-01
    • 2020-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多