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

Flutter iOS应用构建失败求助:iPhone 13模拟器仅首次启动可运行,关闭后无法重新运行

Fixing Flutter iOS Build Failures (Font Missing + Simulator Restart Issues)

Hey there, let's tackle your build problems step by step—your logs already point to a clear culprit first, and we'll fix that plus the simulator restart issue right after.

First: Fix the Missing Font Resource Error

The critical error stopping your build is this line from your logs:

错误:在pubspec.yaml中无法找到资源条目:"fonts/Arima-Regular.ttf"。

Here's how to resolve it:

  • Verify the font file path exists
    Double-check that your project root has a fonts folder containing exactly Arima-Regular.ttf. Remember, iOS is case-sensitive—if the filename is arima-regular.ttf instead of Arima-Regular.ttf, that'll cause a miss.
  • Fix your pubspec.yaml configuration
    Make sure your font declaration is properly indented (YAML is strict about this!). It should look like this:
    flutter:
      uses-material-design: true
      # Add this fonts section (match indentation exactly)
      fonts:
        - family: Arima
          fonts:
            - asset: fonts/Arima-Regular.ttf
    
  • Clear Flutter cache and reload dependencies
    Run these commands in your project terminal:
    flutter clean
    flutter pub get
    

Next: Fix the Simulator Restart Build Failure

Once the font issue is fixed, if you still can't build after restarting the iPhone 13 simulator, try these steps:

  • Clean Xcode's build folder
    Open your project's ios folder in Xcode, then go to Product > Clean Build Folder (use the shortcut Cmd + Shift + K). Close Xcode, then try running your Flutter app again.
  • Reset the simulator to factory settings
    Open the iPhone 13 simulator, go to Device > Erase All Content and Settings. Wait for it to reset, then launch your app again from Flutter.
  • Regenerate iOS project files
    Sometimes corrupted iOS config files cause persistent issues. Back up any custom changes in your ios folder (like Info.plist entries), then delete the ios folder entirely. Run this command to regenerate it:
    flutter create --platforms ios .
    
    Then reapply your custom iOS settings if needed.
  • Check Flutter and Xcode compatibility
    Run flutter doctor in your terminal—this will flag any version mismatches or missing tools. Follow the prompts to update Flutter, Xcode, or any required components.

Note: The Xcode extension point warnings in your logs (like "请求但未找到标识符为Xcode.IDEKit.ExtensionSentinelHostApplications的扩展点") are usually harmless and won't stop your build—focus on fixing the font and simulator cache issues first.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.27 20:27:42