Skip to content

[iOS]: tool throws Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found error pointing to path_provider_ios-2.0.8/ios/Classes/FLTPathProviderPlugin.h:4:8 #99229

@ukblumf

Description

@ukblumf

Steps to Reproduce

Apple M1 Mac
Cocoapods installed via brew
Using either Visual Studio Code or Android Studio
Use a dependency such as path_provider
flutter get pub
set device simulator to iPhone (13 pro)
flutter run

Expected results:
App to Launch successfully

Actual results:
Error
Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found
/Volumes/T7/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_ios-2.0.8/ios/Classes/FLTPathProviderPlugin.h:4:8

Logs

Attached is the flutter run -verbose
flutter-run-verbose-header file not found issue.txt

Screenshot of iOS/build folder
Screenshot 2022-02-27 at 10 46 59

flutter doctor -v
[✓] Flutter (Channel stable, 2.10.2, on macOS 12.2.1 21D62 darwin-arm, locale en-GB)
• Flutter version 2.10.2 at /Volumes/T7/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 097d331 (8 days ago), 2022-02-18 19:33:08 -0600
• Engine revision a83ed0e5e3
• Dart version 2.16.1
• DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /Users/blumf/Library/Android/sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at: /Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 17.0.2+8-LTS-86)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.64.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.34.0

[✓] Connected device (2 available)
• iPhone 13 Pro (mobile) • E792BB5C-84A9-4F3E-A18F-D1CBDFA19580 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.109

[✓] HTTP Host Availability
• All required HTTP hosts are available

• No issues found!

Additional Notes

I did some analysis on the verbose output and I noticed something odd in the Build Settings:

FRAMEWORK_SEARCH_PATHS = "/Volumes/T7/initiative_tracker2/build/ios/Debug-iphoneos/path_provider_ios"
HEADER_SEARCH_PATHS = "/Volumes/T7/initiative_tracker2/build/ios/Debug-iphoneos/path_provider_ios/path_provider_ios.framework/Headers"

The 'Debug-iphoneos' folder does not exist in the build/iOS folder, but there is a 'Debug-iphonesimulator'
Please see attached screenshot.

It could be that the incorrect header/framework search paths are being sent to Xcode and it is unable to find the dependency package headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consoleplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versiontoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions