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 afontsfolder containing exactlyArima-Regular.ttf. Remember, iOS is case-sensitive—if the filename isarima-regular.ttfinstead ofArima-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'siosfolder in Xcode, then go toProduct > Clean Build Folder(use the shortcutCmd + Shift + K). Close Xcode, then try running your Flutter app again. - Reset the simulator to factory settings
Open the iPhone 13 simulator, go toDevice > 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 youriosfolder (like Info.plist entries), then delete theiosfolder entirely. Run this command to regenerate it:
Then reapply your custom iOS settings if needed.flutter create --platforms ios . - Check Flutter and Xcode compatibility
Runflutter doctorin 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
相关产品推荐
相关产品推荐

