fatal error: 'Flutter/Flutter.h' file not found when running for iOS

2,194

You should go to /Users/interno/Documents/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/ delete the folder url_launcher and go to your terminal and run flutter pub get

Share:
2,194
HelloWorldd
Author by

HelloWorldd

Updated on December 29, 2022

Comments

  • HelloWorldd
    HelloWorldd over 1 year

    I have a flutter app which was using only the android side. Now I want to run it on a iPad but it throws this error:

    Error output from Xcode build:
    ↳
        2021-04-19 11:31:26.233 xcodebuild[21793:154600]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-17705/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
        Details:  (null) deviceType from 00008101-00126D441E38001E was NULL when -platform called.
        Object:   <DTDKMobileDeviceToken: 0x7f8196cb0f70>
        Method:   -platform
        Thread:   <NSThread: 0x7f8196c6dc80>{number = 8, name = (null)}
        Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
        2021-04-19 11:31:26.651 xcodebuild[21793:154569]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-17705/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
        Details:  (null) deviceType from 00008101-00126D441E38001E was NULL when -platform called.
        Object:   <DTDKMobileDeviceToken: 0x7f8196cb0f70>
        Method:   -platform
        Thread:   <NSThread: 0x7f8196a38370>{number = 5, name = (null)}
        Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
        2021-04-19 11:31:26.835 xcodebuild[21793:154569]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-17705/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
        Details:  (null) deviceType from 00008101-00126D441E38001E was NULL when -platform called.
        Object:   <DTDKMobileDeviceToken: 0x7f8196cb0f70>
        Method:   -platform
        Thread:   <NSThread: 0x7f8196a38370>{number = 5, name = (null)}
        Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
        ** BUILD FAILED **
    
    
    Xcode's output:
    ↳
        In file included from /Users/interno/Documents/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.7.10/ios/Classes/FLTURLLauncherPlugin.m:7:
        /Users/interno/Documents/FlutterSDK/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.
        Command CompileSwift failed with a nonzero exit code
        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.
    
    

    Things I already tried:

    • Run flutter clean
    • pod install
    • pod update
    • Delete the 'iOS' folder and run 'flutter create'

    What I have to do to fix it?

  • Yann Massard
    Yann Massard almost 3 years
    you mean flutter pub get ?