Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter/ fatal error: 'Flutter/Flutter.h' file not found

Tags:

flutter

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!
like image 730
DaegilPyo Avatar asked Dec 15 '20 20:12

DaegilPyo


1 Answers

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.

like image 143
Darsh Shah Avatar answered Nov 12 '22 06:11

Darsh Shah