Skip to content

"Flutter/Flutter.h not found." on iOS. #16036

@jeroen-meijer

Description

@jeroen-meijer

Steps to Reproduce

Preface:

I'm on the flutter master channel and have run upgrade half an hour ago.
I've reinstalled flutter and cocoapods completely before and tried the fixes provided in #15437, #15532 and all other issues on GitHub looking like the problem I have. _

flutter create --template=plugin -i swift health_stats
cd health_stats/example

health_stats.zip

Logs

Run your application with flutter run and attach all the log output.

Launching lib/main.dart on iPhone 6 in debug mode...
Running Xcode clean...                                       0,9s
Starting Xcode build...
Xcode build done                                             1,1s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output:
↳
    === BUILD TARGET health_stats OF PROJECT Pods WITH CONFIGURATION Debug ===
    <module-includes>:1:9: note: in file included from <module-includes>:1:
    #import "Headers/health_stats-umbrella.h"
            ^
    /Users/jeroen/Projects/_flutter_experiments/health_stats/example/ios/Pods/Target Support Files/health_stats/health_stats-umbrella.h:13:9: note: in file included from /Users/jeroen/Projects/_flutter_experiments/health_stats/example/ios/Pods/Target Support Files/health_stats/health_stats-umbrella.h:13:
    #import "HealthStatsPlugin.h"
            ^
    /Users/jeroen/Projects/_flutter_experiments/health_stats/ios/Classes/HealthStatsPlugin.h:1:9: error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^
    <unknown>:0: error: could not build Objective-C module 'health_stats'
Could not build the application for the simulator.
Error launching application on iPhone 6.

Run flutter analyze and attach any output of that command also.

Analyzing /Users/jeroen/Projects/_flutter_experiments/health_stats/example...
No issues found!
Ran in 5.7s

Flutter Doctor

Paste the output of running flutter doctor -v here.

[✓] Flutter (Channel master, v0.2.5-pre.60, on Mac OS X 10.13.3 17D102, locale nl-NL)
    • Flutter version 0.2.5-pre.60 at /Users/Jeroen/flutter
    • Framework revision 31049a5a73 (64 minutes ago), 2018-03-28 10:58:48 -0700
    • Engine revision dd6f46c485
    • Dart version 2.0.0-dev.41.0.flutter-2f68e82526

[✓] Android toolchain - develop for Android devices (Android SDK 26.0.3)
    • Android SDK at /Users/jeroen/Library/Developer/Xamarin/android-sdk-macosx
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 26.0.3
    • ANDROID_HOME = /Users/jeroen/Library/Developer/Xamarin/android-sdk-macosx
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
    • Xcode at /Applications/Xcode-beta.app/Contents/Developer
    • Xcode 9.3, Build version 9Q127n
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.0.beta.1

[✓] Android Studio (version 3.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] VS Code (version 1.21.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Dart Code extension version 2.11.1

[✓] Connected devices (1 available)
    • iPhone 6 • B93E29EC-05E0-4948-B369-BB8B2347823D • ios • iOS 11.3 (simulator)

• No issues found!

Additional information

Creating and running a normal project works fine:
flutter create regular
cd regular
flutter run

Launching lib/main.dart on iPhone 6 in debug mode...
Running Xcode clean...                                       0,9s
Starting Xcode build...
 ├─Assembling Flutter resources...                    3,4s
 └─Compiling, linking and signing...                  5,1s
Xcode build done                                             9,7s
Syncing files to device iPhone 6...                          2,0s

🔥  To hot reload your app on the fly, press "r". To restart the app entirely, press "R".
An Observatory debugger and profiler on iPhone 6 is available at: http://127.0.0.1:8100/
For a more detailed help message, press "h". To quit, press "q".

However when adding a dependency like path_provider:

...
dependencies:
  flutter:
    sdk: flutter
  path_provider: ^0.4.0 [ADDED THIS LINE]
...

and then flutter packages get,

[regular] flutter packages get
Running "flutter packages get" in regular...
exit code 0

flutter run produces this:

Launching lib/main.dart on iPhone 6 in debug mode...
Running pod install...                                       1,0s
Running Xcode clean...                                       0,9s
Starting Xcode build...
Xcode build done                                             1,4s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output:
↳
    === BUILD TARGET path_provider OF PROJECT Pods WITH CONFIGURATION Debug ===
    In file included from /Users/jeroen/.pub-cache/hosted/pub.dartlang.org/path_provider-0.4.0/ios/Classes/PathProviderPlugin.m:5:
    /Users/jeroen/.pub-cache/hosted/pub.dartlang.org/path_provider-0.4.0/ios/Classes/PathProviderPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
Could not build the application for the simulator.
Error launching application on iPhone 6.

I did not have path_provider version 0.4.0 in my dart packages folder before running the app, so it's a fresh copy.

I need to get this working a.s.a.p. since I need to make an app for our company soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions