Repository navigation
Xcode build error: include of non-modular header inside framework module #15173
Copy link
Copy link
Closed
Labels
c: crashStack traces logged to the consoleStack traces logged to the consolep: toolingAffects the flutter_plugin_tools packageAffects the flutter_plugin_tools packageplatform-iosiOS applications specificallyiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Steps to Reproduce
Create a plugin package as per the documentation using Swift in iOS and build it for ios:
flutter create --template=plugin -i swift hello
cd hello/example
flutter build ios --no-codesign
Logs
...
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET hello OF PROJECT Pods WITH CONFIGURATION Release ===
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/hello-umbrella.h"
^
xxx/hello/example/ios/Pods/Target Support Files/hello/hello-umbrella.h:13:9: error: include of non-modular header inside framework module 'hello': 'xxx/hello/ios/Classes/HelloPlugin.h'
#import "HelloPlugin.h"
^
<unknown>:0: error: could not build Objective-C module 'hello'
Recently upgraded to flutter beta. I've created plugin packages before in the alpha channel without problems.
Flutter Doctor
[✓] Flutter (Channel beta, v0.1.5, on Mac OS X 10.13.3 17D102, locale en-NL)
• Flutter version 0.1.5 at /Users/kozw/Source/flutter
• Framework revision 3ea4d06340 (11 days ago), 2018-02-22 11:12:39 -0800
• Engine revision ead227f118
• Dart version 2.0.0-dev.28.0.flutter-0b4f01f759
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/kozw/Library/Android/sdk
• Android NDK at /Users/kozw/Library/Android/sdk/ndk-bundle
• Platform android-27, build-tools 27.0.3
• 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)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.2, Build version 9C40b
• ios-deploy 1.9.2
• CocoaPods version 1.4.0
[✓] 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.20.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Dart Code extension version 2.9.2
[✓] Connected devices (1 available)
• iPhone 8 • D5FC98FA-D6B0-41D2-B834-B7FFFEB1B506 • ios • iOS 11.2 (simulator)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
c: crashStack traces logged to the consoleStack traces logged to the consolep: toolingAffects the flutter_plugin_tools packageAffects the flutter_plugin_tools packageplatform-iosiOS applications specificallyiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
willks commentedon Mar 7, 2018
I get this too when trying to make a Swift plugin inside the flutter project. I'm using the command:
and I get the same error sans file path:
Pretty much renders us making plugins in Swift as a no go. This is critical for us as the Flutter community for plugins is young, and we need plugin builders. I personally am trying to make a wrapper for Couchbase-Lite 2.0.0B, so that we have a proper JSON store with search capability for 100% offline apps in iOS and Android.
I don't get this error in ObjC tests but we're not going near ObjC.
Thanks for the great work so far BTW - Flutter is awesome!
kozw commentedon Mar 9, 2018
Looks like the created Podfile is the culprit. When I remove Podfile.lock and replace Podfile in the example/ios folder with a version I took from the flutter alpha branch, the build succeeds.
Attached the Podfile from the alpha branch if you want to try it out for yourself (make sure you remove Podfile.lock first). Disclaimer: I'm no Xcode build expert, I'm unaware of any unwanted side effects. Use at your own risk. This issue should be addressed by the flutter team.
Podfile.zip
gahfy commentedon Mar 11, 2018
@kozw You saved my life!!! Thanks
willks commentedon Mar 11, 2018
@kozw Thanks for working around it. As an iOS dev (Swift) - I'm now doing Android dev to prove the Flutter PoC for our company. Seriously, not easy to wrap CouchBase Lite :) i'm 70% there.
kozw commentedon Mar 24, 2018
Looks like the issue is resolved in the master branch. See also #15763
kozw commentedon Apr 11, 2018
Scratch that, error still exists in Flutter beta v0.2.8
kozw commentedon Apr 11, 2018
Looks like the real solution can be found here => #16049
zoechi commentedon Dec 21, 2018
Duplicate of #16049
github-actions commentedon Aug 15, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.