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

Flutter开发Face ID认证遇iOS报错:@import local_auth not found求助

解决iOS平台local_auth插件"@import local_auth" not found错误

针对你使用Flutter 3.0.5 + local_auth: ^2.1.2遇到的问题,可按以下步骤排查修复:

  • 清理重构项目

    1. 在Flutter项目根目录执行:
      flutter clean
      
    2. 删除iOS目录下的Pods文件夹和Podfile.lock文件
    3. 进入iOS目录,依次执行:
      pod deintegrate
      pod install
      
    4. 返回项目根目录重新运行:
      flutter run
      
  • 检查Podfile平台版本配置
    local_auth: ^2.1.2要求iOS最低版本为12.0,确保iOS目录下的Podfile顶部配置正确:

    platform :ios, '12.0'
    

    修改后重新执行pod install。

  • 验证插件集成状态
    打开iOS项目的.xcworkspace文件(不要用.xcodeproj),检查Pods目录下是否存在local_auth插件。若缺失:

    1. 确认pubspec.yaml中已正确添加local_auth: ^2.1.2
    2. 执行flutter pub get
    3. 重新执行pod install
  • 清理Xcode缓存
    打开Xcode,点击菜单栏Product -> Clean Build Folder,重启Xcode后再运行项目。

内容的提问来源于stack exchange,提问作者prodip bhattacharjee

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.20 14:51:24