You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter集成Google Map后跳转页面时iOS端崩溃求助

iOS端Google地图页面跳转崩溃问题
  • 依赖版本:google_maps_flutter: ^2.3.1
  • 问题现象:Android全设备/模拟器运行正常;iOS模拟器及真机仅在从Google地图页面跳转至其他页面时崩溃

跳转按钮代码

onPressed: () { Navigator.pushReplacementNamed(context, '/edit-visits'); },

Flutter控制台报错信息

[        ] Lost connection to device.

[   +1 ms] DevFS: Deleting filesystem on the device (file:///Users/plego/Library/Developer/CoreSimulator/Devices/94901D34-C92B-42B9-A9AD-0B98E1F74F42/data/Containers/Data/Application/BCA77063-70EB-4CD2-A470-92498CAC0797/tmp/ameripro_app_may19UDSnvp/ameripro_app_may19/)

[   +5 ms] executing: /usr/bin/arch -arm64e xcrun simctl terminate 94901D34-C92B-42B9-A9AD-0B98E1F74F42 com.plego.ameripro

Xcode报错截图

Xcode报错截图

AppDelegate.swift代码

import UIKit
import Flutter
import GoogleMaps

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
      GMSServices.setMetalRendererEnabled(true)
      GMSServices.provideAPIKey("YES MY KEY")
   
      GeneratedPluginRegistrant.register(with: self)
      return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

已尝试多种网络上的解决方案,耗时数小时仍未解决该崩溃问题。

内容的提问来源于stack exchange,提问作者Atif Naseem

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.17 20:52:26