0

I have a flutter package that works well, aside from a few caveats related to iOS. One of those is this pesky error.

error: include of non-modular header inside framework module

I am able to fix this in xcode but setting the build setting for "Allow non-modular header" to yes. Found that solution here. However, this is an extra step for the developer and I would rather be able to fix it in my package.

I figured that I could fix this by maybe changing the format of imports in my Objective C files. Right now they use this format: #import "MyFramework.h". That seems to be the part that trips up the xcode build in my IDE.

 /Users/rootuser/Development/FLUTTER-DEV/my_app/build/ios/Debug-iphoneos/framework_package/framework_package.framework/Headers/Connector.h:3:9: error: include of non-modular header inside framework module
    'framework_package.Connector': '/Users/rootuser/Development/FLUTTER-DEV/my_app/build/ios/Debug-iphoneos/FrameworkObjC/FrameworkObjC.framework/Headers/Framework.h'
    [-Werror,-Wnon-modular-include-in-framework-module]
    #import "MyFramework.h"

For this, I have two questions.

  1. Is this safe/good practice?
  2. How can I change the format to be permissible? I see that some imports look like this: #import <Flutter/Flutter.h> rather than in quotes. Can I simply change my import to something like #import <Framework/Framework.h?
Matt Croak
  • 2,587
  • 2
  • 15
  • 30

0 Answers0