11

Hello i am having this error when I run my app.

Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    In file included from /Users/daegilpyo/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.7.10/ios/Classes/FLTURLLauncherPlugin.m:7:
    /Users/daegilpyo/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.7.10/ios/Classes/FLTURLLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
5
    Command CompileSwift failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
Could not build the precompiled application for the device.

Error launching application on DAEGIL의 iPhone.
Exited (sigterm)

This is happening after I change the channel from stable to master.. I don`t know why I am having this error.

Plz let me know, I am waiting for you help..

this is flutter doctor - v

[✓] Flutter (Channel stable, 1.22.5, on macOS 11.0.1 20B50 darwin-x64, locale en-CA)
    • Flutter version 1.22.5 at /Users/daegilpyo/Developer/flutter
    • Framework revision 7891006299 (5 days ago), 2020-12-10 11:54:40 -0800
    • Engine revision ae90085a84
    • Dart version 2.10.4

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/daegilpyo/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Applications/12.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.10.0

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/12.app/Contents
    • Flutter plugin version 47.1.1
    • Dart plugin version 192.8052
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] Connected device (1 available)
    • DAEGIL의 iPhone (mobile) • 00008020-0011243A2279002E • ios • iOS 14.2

• No issues found!

2 Answers 2

13

I had this problem a week ago, I removed the ios/Flutter folder from my directory and ran these commands and changed by deployment target to 11.0

-> flutter create
-> flutter pub cache repair
-> cd ios 
-> pod init 
-> pod install 

After following these commands, I could build the iOS on the simulator and also create the archive.

Sign up to request clarification or add additional context in comments.

5 Comments

For a safer side get a backup of the deleted folder
Thank you so much it worked!!. I was struggling with this issue for about 5 hours. You saved my life. Thank you again.
The answer is so incomplete, whee to run the commands, what to do with the deleted folder, what to do with this new project ????
We need to run these commands in the terminal in your project directory, So when you run these commands in your project directory it will create new iOS and Android folder with the correct build settings. Hope that answers all your questions.
I am using the azure pipeline and I get "Flutter/Flutter.h' file not found" error. How can I handle it?
-2

The project absolute path don't have Space ' '.

My project path is '/Volumes/Macintosh Data/work/test/ios' then error, move to '/Users/macbook/Documents/workspace/test/ios' is OK.

if modify pubspec.yaml file dependencies, then redo:

rm -rf ./ios
flutter create -i swift .

2 Comments

Check out How to Answer to improve this answer
Please be careful when posting code that includes rm -rf. The way your answer was formattted could have created lots of issues for anyone using it as is. I've fixed it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.