Build Errors on macOS due to non-modular header Includes on ios-no-type-b branch
When building a Flutter project on a macOS device for an iphone device, the following build errors are encountered:
Could not build the precompiled application for the device.
Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'another_brother.BrotherManager': '/Users/username/Projects/your-flutter-app/ios/Pods/BRLMPrinterKit/BRLMPrinterKit/BRLMPrinterKit.framework/Headers/BRLMPrinterKit.h'
/Users/username/.pub-cache/git/another_brother-4df113188004959c3dacba35a990ba3a6c989887/ios/Classes/BrotherManager.h:11:8
BrotherManager.h:11
Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'another_brother.BrotherUtils': '/Users/username/Projects/your-flutter-app/ios/Pods/BRLMPrinterKit/BRLMPrinterKit/BRLMPrinterKit.framework/Headers/BRLMPrinterKit.h'
/Users/username/.pub-cache/git/another_brother-4df113188004959c3dacba35a990ba3a6c989887/ios/Classes/Method/BrotherUtils.h:11:8
BrotherUtils.h:11
Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'another_brother.BrotherUtils': '/Users/username/Projects/your-flutter-app/ios/Pods/BRLMPrinterKit/BRLMPrinterKit/BRLMPrinterKit.framework/Headers/BRLMPrinterDefine.h'
/Users/username/.pub-cache/git/another_brother-4df113188004959c3dacba35a990ba3a6c989887/ios/Classes/Method/BrotherUtils.h:12:8
BrotherUtils.h:12
Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'another_brother.BrotherUtils': '/Users/username/Projects/your-flutter-app/ios/Pods/BRLMPrinterKit/BRLMPrinterKit/BRLMPrinterKit.framework/Headers/BRPtouchPrinterKit.h'
/Users/username/.pub-cache/git/another_brother-4df113188004959c3dacba35a990ba3a6c989887/ios/Classes/Method/BrotherUtils.h:13:8
BrotherUtils.h:13
Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'another_brother.GetBluetoothPrintersMethodCall': '/Users/username/Projects/your-flutter-app/ios/Pods/BRLMPrinterKit/BRLMPrinterKit/BRLMPrinterKit.framework/Headers/BRPtouchPrinterKit.h'
/Users/username/.pub-cache/git/another_brother-4df113188004959c3dacba35a990ba3a6c989887/ios/Classes/Method/GetBluetoothPrintersMethodCall.h:11:8
GetBluetoothPrintersMethodCall.h:11
Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside framework module 'another_brother.GetNetPrintersMethodCall': '/Users/username/Projects/your-flutter-app/ios/Pods/BRLMPrinterKit/BRLMPrinterKit/BRLMPrinterKit.framework/Headers/BRPtouchPrinterKit.h'
/Users/username/.pub-cache/git/another_brother-4df113188004959c3dacba35a990ba3a6c989887/ios/Classes/Method/GetNetPrintersMethodCall.h:11:8
GetNetPrintersMethodCall.h:11
Environment:
- Flutter version: 3.22.0
- macOS version: 14.0 (m2)
- Xcode version: 15.4
- Dart version: 3.4.0
Additional Information: I tried to run the build with #52, but it doesn't change anything.
Hi @ablause ,
Thanks for reaching out about this. From the error message it seems you might be missing one of the setup steps for iOS. The video may be found in the ReadMe but here is the link for convenience https://youtu.be/AcFnd-6hSew?si=UXa4bfDDmBLT7gIj&t=109
Hello @CodeMinion,
The option to activate “Allow Non-modular Includes In Framework Modules” does not seem to exist. When I open either Runner.xcworkspace or Runner.xcodeproj and navigate to Runner > Build Settings > Apple Clang - Language - Modules, the setting is not available.
Could you help me with this, is there any other way?
Thank you for your assistance.
Thanks for sharing the screen shot @SoCaliOS !
@ablause , unfortunately I do not use xCode enough to be able to point you where the location of this toggle is in your current version. The version I used is the one captured in the video.
Hope the screenshot from @SoCaliOS is able to help, otherwise I recommend reaching out on an iOS specific channel for where to find it in your xCode version.