Я всюду искал руководство о том, как включить карты Google в настольное приложение флаттера. Я пытался следовать руководству iOS, но не получилось. Я сделал следующее в AppDelegate.swift в каталоге macos/Runner
import Cocoa
import FlutterMacOS
import GoogleMaps
@NSApplicationMain
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
GMSServices.provideAPIKey("MY_API_KEY")
return true
}
}
Но я всегда получаю следующую ошибку
The following build commands failed:
CompileSwift normal x86_64 /Users/xxxxx/xxxxx/xxxxxx/xxxxx/macos/Runner/AppDelegate.swift
CompileSwift normal x86_64 /Users/xxxxxxx/xxxxxx/xxxxxx/xxxxxx/macos/Flutter/GeneratedPluginRegistrant.swift
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(3 failures)
Finished with error: Build process failed