wakelock_plus icon indicating copy to clipboard operation
wakelock_plus copied to clipboard

'Flutter/Flutter.h' file not found on iOS build

Open MercyOdunjo opened this issue 1 year ago • 8 comments

Whenever I try to run an iOS build of my app that has the wakelock plus package, I always get this error. What can be done to fix this?

MercyOdunjo avatar Mar 07 '24 14:03 MercyOdunjo

Same problem Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found /Users/x/.pub-cache/hosted/pub.dev/wakelock_plus-1.2.5/ios/Classes/messages.g.m:8:8

MustafaGaber avatar May 27 '24 23:05 MustafaGaber

Same here.

falniak95 avatar Jun 20 '24 13:06 falniak95

Same here

gokhanvaris avatar Jun 20 '24 13:06 gokhanvaris

Same here. I try add: flutter_additional_ios_build_settings(target) in the "post_install do", but have new bug rvm version

dekapro9x avatar Jul 26 '24 20:07 dekapro9x

Issue: 'Flutter/Flutter.h' file not found during iOS build

Description: I am encountering a Lexical or Preprocessor Issue when trying to build my iOS app that uses wakelock_plus. The error states that 'Flutter/Flutter.h' file not found.

Here is the output:

Running Xcode build...
Xcode build done. 13.1s Failed to build iOS app

Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found /Users/ms/.pub-cache/hosted/pub.dev/wakelock_plus-1.2.8/ios/Classes/messages.g.m:8:8

Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found /Users/ms/.pub-cache/hosted/pub.dev/wakelock_plus-1.2.8/ios/Classes/WakelockPlusPlugin.h:0:8

Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found /Users/ms/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.6.1/darwin/video_player_avfoundation /Sources/video_player_avfoundation/messages.g.m:11:8

Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found /Users/ms/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.6.1/darwin/video_player_avfoundation /Sources/video_player_avfoundation/include/video_player_avfoundation/FVPVideoPlayerPlugin.h:7:8

Lexical or Preprocessor Issue (Xcode): 'Flutter/Flutter.h' file not found /Users/ms/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.6.1/darwin/video_player_avfoundation /Sources/video_player_avfoundation/include/video_player_avfoundation/FVPDisplayLink.h:9:8

Could not build the application for the simulator. Error launching application on iPhone 16 Pro Max.

qays3 avatar Sep 27 '24 15:09 qays3

@MercyOdunjo @falniak95 @dekapro9x @MustafaGaber @gokhanvaris I am getting the same error, is this issue resolved. Kindly update.

sunilflutterwebcom avatar Feb 20 '25 08:02 sunilflutterwebcom

@sunilflutterwebcom I found that this issue is not actually a wakelock problem as shown in @qays3 's build error message. I have had this same error from different other packages on my app at different times. What works for me in recent times, even today, is to do:

flutter clean
flutter pub get
cd ios
pod update

And then run your app normally after the above steps. Sometimes you might have to delete the Podfile.lock file in your ios folder and rerun the steps if it doesn't work the first time. The Podfile.lock and NOT the Podfile itself.

MercyOdunjo avatar Feb 20 '25 14:02 MercyOdunjo