Flutter app, cannot build the app in simulator

1,683
  1. Remove ios/Flutter/Flutter.podspec: rm ios/Flutter/Flutter.podspec
  2. Run flutter clean
  3. Run your app again.

If this doesnt solve the issue, try some solutions available here

Share:
1,683
Sarah
Author by

Sarah

Updated on December 30, 2022

Comments

  • Sarah
    Sarah over 1 year

    First time posting on stackoverflow. I feel like I'm entering into the "club" lol.

    So I'm trying to launch this flutter app on iOS (app already on Google Play). But somehow, I can't run my app on my iOS Simulator, idk why.

    • the first review of apple was about a crash happening when they try to do a selfie (as required in the app).
    • flutter doctor is all OK

    Here is what I obtain when I do flutter run output in my terminal:

    Launching lib/main.dart on iPhone 13 in debug mode... Running pod install... 1,727ms Running Xcode build... Xcode build done. 4.8s Failed to build iOS app Error output from Xcode build: ↳ --- xcodebuild: WARNING: Using the first of multiple matching destinations: { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device } { platform:iOS Simulator, id:D424EE87-EB4D-4A29-9E94-DC59C99BBA35, OS:15.2, name:iPad (9th generation) } { platform:iOS Simulator, id:7765E563-ADEF-4A57-8E0B-E691DB98C9F1, OS:15.2, name:iPad Air (4th generation) } { platform:iOS Simulator, id:A2610203-CC63-4CF4-B46A-3FFF24E717FF, OS:15.2, name:iPad Pro (9.7-inch) } { platform:iOS Simulator, id:A43F9F16-5269-47DD-B798-16BA558D3207, OS:15.2, name:iPad Pro (11-inch) (3rd generation) } { platform:iOS Simulator, id:94F13A16-0D1B-40BB-89A6-309B7F46CFEB, OS:15.2, name:iPad Pro (12.9-inch) (5th generation) } { platform:iOS Simulator, id:369BDA2B-D9AB-440D-B782-3E39D8C9CEC1, OS:15.2, name:iPad mini (6th generation) } { platform:iOS Simulator, id:E45C9138-95FD-4987-AE59-B461B9E4FC8C, OS:15.2, name:iPhone 8 } { platform:iOS Simulator, id:95E79F73-615B-47F2-8D23-569D79D5ACC0, OS:15.2, name:iPhone 8 Plus } { platform:iOS Simulator, id:409F076D-F8F3-41E7-8517-193BB48EA3E8, OS:15.2, name:iPhone 11 } { platform:iOS Simulator, id:B01B72C7-9CC4-4A17-B04C-1F131D786EE6, OS:15.2, name:iPhone 11 Pro } { platform:iOS Simulator, id:E705E2B3-8B05-43CF-8B00-0092A4D102A9, OS:15.2, name:iPhone 11 Pro Max } { platform:iOS Simulator, id:AFA7446A-7FA9-424B-9ECF-0D5A4B52C1A3, OS:15.2, name:iPhone 12 } { platform:iOS Simulator, id:DB221437-B4E7-4AC9-BBD6-032CFE0E0B1A, OS:15.2, name:iPhone 12 Pro } { platform:iOS Simulator, id:AC2B37A8-B4CB-434A-A972-DBD779D1577A, OS:15.2, name:iPhone 12 Pro Max } { platform:iOS Simulator, id:2F454258-F53C-48FD-9FBF-2942CBCC6CE4, OS:15.2, name:iPhone 12 mini } { platform:iOS Simulator, id:EBDF7EE2-F8C9-46F5-9253-09EBF510617E, OS:15.2, name:iPhone 13 } { platform:iOS Simulator, id:82BC8558-2A46-40F0-993D-F39F211EFBD7, OS:15.2, name:iPhone 13 Pro } { platform:iOS Simulator, id:3277A604-1D73-45C3-87AD-77A529F023B2, OS:15.2, name:iPhone 13 Pro Max } { platform:iOS Simulator, id:E58CD9B9-F99A-4477-9CC3-BED299852480, OS:15.2, name:iPhone 13 mini } { platform:iOS Simulator, id:9609638C-212C-4BAE-979E-77CAC7060F19, OS:15.2, name:iPhone SE (2nd generation) } { platform:iOS Simulator, id:278C8EA3-F49D-4BF3-961E-CEBCF98F3094, OS:15.2, name:iPod touch (7th generation) } { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device } ** BUILD FAILED **

    Xcode's output: ↳ In file included from /Users/sarahmellouki/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.8.0+4/ios/Classes/FLT ImagePickerPlugin.m:5: /Users/sarahmellouki/Development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.8.0+4/ios/Classes/FLT ImagePickerPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found #import <Flutter/Flutter.h> ^~~~~~~~~~~~~~~~~~~ 1 error generated. note: Using new build system note: Planning note: Build preparation complete note: Building targets in dependency order

    Could not build the application for the simulator. Error launching application on iPhone 13.

    Thanks for your help

  • Sarah
    Sarah over 2 years
    Thanks for the reply. I deleted the file, did flutter clean and ran the app, but unfortunately it didn't work. Same issue, same output + it regenerated the flutter.podspec file...