XcodeにてGoogleMapSDKを使用しマップを使用したアプリを作成しているのですが実行した瞬間にブレークします。
エラー: Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
まだほとんど何もできておりません。
Googleの公式ドキュメント通りに進んだのでなぜエラーを吐くのかが分からずに困っております。
AppDelegateswift
1mport UIKit 2import GoogleMaps 3 4@UIApplicationMain 5class AppDelegate: UIResponder, UIApplicationDelegate { **左のここでエラーが発生** 6 7 8 9 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 10 // Override point for customization after application launch. 11 GMSServices.provideAPIKey("自分のAPIキーを使用しました。") 12 return true 13 } 14 15 // MARK: UISceneSession Lifecycle 16 17 func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 18 // Called when a new scene session is being created. 19 // Use this method to select a configuration to create the new scene with. 20 return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 21 } 22 23 func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { 24 // Called when the user discards a scene session. 25 // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 26 // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 27 } 28 29 30} 31 32
ViewControllerswift
1import UIKit 2import GoogleMaps 3 4class ViewController: UIViewController { 5 6 7 override func viewDidLoad() { 8 super.viewDidLoad() 9 let camera = GMSCameraPosition.camera(withLatitude: -33.86, longitude: 151.20, zoom: 6.0) 10 let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera) 11 view = mapView 12 13 // Creates a marker in the center of the map. 14 let marker = GMSMarker() 15 marker.position = CLLocationCoordinate2D(latitude: -33.86, longitude: 151.20) 16 marker.title = "Sydney" 17 marker.snippet = "Australia" 18 marker.map = mapView 19 } 20 21} 22
申し訳ございませんがどなたか教えていただけないでしょうか。
よろしくお願いいたします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/03/23 07:58
2020/03/23 08:10
2020/03/23 08:14