<p dir="auto">I have created a very basic flutter plugin here:<br>
<a href="https://github.com/shehabic/dhplugin">https://github.com/shehabic/dhplugin</a><br>
and used it in this module:<br>
<a href="https://github.com/shehabic/flutter-test-module">https://github.com/shehabic/flutter-test-module</a><br>
this module is supposed to be the module that will have all the customer plugin we'll create in our company, we import this module into our existing apps and it'll grab all of our custom plugins with it.</p>
<p dir="auto">I've spent 5 days now having trouble with and I couldn't get it to work.<br>
here is the error:</p>
<h2 dir="auto">Steps to Reproduce</h2>
<ol dir="auto">
<li>Checkout the module above</li>
<li>Run <code class="notranslate">flutter packages get</code></li>
<li>Run <code class="notranslate">flutter build ios --debug</code></li>
</ol>
<h2 dir="auto">Logs</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Building com.shehabic.module.mymodule for device (ios)...
Signing iOS app for device deployment using developer identity: &quot;iPhone Developer: My Name (TeamNumber)&quot;
Starting Xcode build...
Xcode build done.                                            9.1s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    === BUILD TARGET flutter_webview_plugin OF PROJECT Pods WITH CONFIGURATION Debug ===
    dhplugin.xcconfig line 12: Unable to find included file &quot;../.ios/Flutter/Generated.xcconfig&quot;
    dhplugin.xcconfig line 13: Unable to find included file &quot;../.ios/Flutter/Generated.xcconfig&quot;
    === BUILD TARGET flutter_webview_plugin OF PROJECT Pods WITH CONFIGURATION Debug ===
    /Users/shehabic/development/flutter/.pub-cache/git/dhplugin-d25caf5fc30cf036675d3e2a4fab393243f112f2/ios/Classes/DhpluginPlugin.m:2:9: fatal error:
    'dhplugin/dhplugin-Swift.h' file not found
    #import &lt;dhplugin/dhplugin-Swift.h&gt;
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    flutter_webview_plugin.xcconfig line 11: Unable to find included file &quot;../.ios/Flutter/Generated.xcconfig&quot;
    flutter_webview_plugin.xcconfig line 12: Unable to find included file &quot;../.ios/Flutter/Generated.xcconfig&quot;
    /Users/shehabic/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.2.1+2/ios/Classes/FlutterWebviewPlugin.m:71:22: warning: incompatible pointer
    to integer conversion assigning to 'BOOL' (aka 'signed char') from 'id _Nullable' [-Wint-conversion]
        _enableAppScheme = call.arguments[@&quot;enableAppScheme&quot;];
                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/shehabic/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.2.1+2/ios/Classes/FlutterWebviewPlugin.m:244:78: warning: values of type
    'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]
        id data = [FlutterError errorWithCode:[NSString stringWithFormat:@&quot;%ld&quot;, error.code]
                                                                           ~~~   ^~~~~~~~~~
                                                                           %ld   (long)
    /Users/shehabic/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.2.1+2/ios/Classes/FlutterWebviewPlugin.m:254:102: warning: values of type
    'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]
            [channel invokeMethod:@&quot;onHttpError&quot; arguments:@{@&quot;code&quot;: [NSString stringWithFormat:@&quot;%ld&quot;, response.statusCode], @&quot;url&quot;: webView.URL.absoluteString}];
                                                                                                   ~~~   ^~~~~~~~~~~~~~~~~~~
                                                                                                   %ld   (long)
    3 warnings generated."><pre class="notranslate"><code class="notranslate">Building com.shehabic.module.mymodule for device (ios)...
Signing iOS app for device deployment using developer identity: "iPhone Developer: My Name (TeamNumber)"
Starting Xcode build...
Xcode build done.                                            9.1s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    === BUILD TARGET flutter_webview_plugin OF PROJECT Pods WITH CONFIGURATION Debug ===
    dhplugin.xcconfig line 12: Unable to find included file "../.ios/Flutter/Generated.xcconfig"
    dhplugin.xcconfig line 13: Unable to find included file "../.ios/Flutter/Generated.xcconfig"
    === BUILD TARGET flutter_webview_plugin OF PROJECT Pods WITH CONFIGURATION Debug ===
    /Users/shehabic/development/flutter/.pub-cache/git/dhplugin-d25caf5fc30cf036675d3e2a4fab393243f112f2/ios/Classes/DhpluginPlugin.m:2:9: fatal error:
    'dhplugin/dhplugin-Swift.h' file not found
    #import &lt;dhplugin/dhplugin-Swift.h&gt;
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    flutter_webview_plugin.xcconfig line 11: Unable to find included file "../.ios/Flutter/Generated.xcconfig"
    flutter_webview_plugin.xcconfig line 12: Unable to find included file "../.ios/Flutter/Generated.xcconfig"
    /Users/shehabic/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.2.1+2/ios/Classes/FlutterWebviewPlugin.m:71:22: warning: incompatible pointer
    to integer conversion assigning to 'BOOL' (aka 'signed char') from 'id _Nullable' [-Wint-conversion]
        _enableAppScheme = call.arguments[@"enableAppScheme"];
                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/shehabic/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.2.1+2/ios/Classes/FlutterWebviewPlugin.m:244:78: warning: values of type
    'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]
        id data = [FlutterError errorWithCode:[NSString stringWithFormat:@"%ld", error.code]
                                                                           ~~~   ^~~~~~~~~~
                                                                           %ld   (long)
    /Users/shehabic/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.2.1+2/ios/Classes/FlutterWebviewPlugin.m:254:102: warning: values of type
    'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]
            [channel invokeMethod:@"onHttpError" arguments:@{@"code": [NSString stringWithFormat:@"%ld", response.statusCode], @"url": webView.URL.absoluteString}];
                                                                                                   ~~~   ^~~~~~~~~~~~~~~~~~~
                                                                                                   %ld   (long)
    3 warnings generated.
</code></pre></div>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v0.10.1-pre.78, on Mac OS X 10.14 18A391, locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
[✓] Android Studio (version 3.2)
[✓] IntelliJ IDEA Community Edition (version 2017.3.2)
[✓] VS Code (version 1.28.2)
[!] Connected device
    ! No devices available"><pre class="notranslate"><code class="notranslate">flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v0.10.1-pre.78, on Mac OS X 10.14 18A391, locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
[✓] Android Studio (version 3.2)
[✓] IntelliJ IDEA Community Edition (version 2017.3.2)
[✓] VS Code (version 1.28.2)
[!] Connected device
    ! No devices available
</code></pre></div>
<p dir="auto">Hi,</p>
<p dir="auto">I’m struggling since the last few days to understand how I can build or use Flutter Platform channel plugins that are written in Swift for the iOS part.</p>
<p dir="auto">To my understanding plugins should not force you to set « use_frameworks! » in your PodFile, because, well, that’s make for example firebase_messaging not working (because this plugin force to comment use_frameworks).</p>
<p dir="auto">So I try to create a plug-in by my own with the Flutter CLI :<br>
<code class="notranslate">flutter create —template=plugins -ios-language swift sample</code></p>
<p dir="auto">The project is generated with the use_frameworks! In PodFile who makes it functionnal but incompatible with most from the start.</p>
<p dir="auto">I’m not an CocoaPods expert but is it still required for Swift Library to use this flag ? I thought that starting at <a href="http://blog.cocoapods.org/CocoaPods-1.5.0/" rel="nofollow">Cocoapod 1.5</a> you could remove the flag. But that’s not working at all.</p>
<p dir="auto">So is it possible to make Flutter Swift plugins who works with firebase plugins ?<br>
If so, can you point me to this direction ? Should the cli create command need to be updated to provide from the start the "good" example project ?</p>
<p dir="auto">If making swift plugins working with "first party" plugins is not possible, is it not wiser to remove the ability to create swift plugins since this is not "future proof" and can produce some awkward ecosystem of plugins.</p>
<p dir="auto">Sorry in advance if what I said is not really relevant, I'm trying to understand "the right way" to make iOS plugins...in Swift (Objective-C is not my cup of tea)</p>
<h2 dir="auto">Steps to Reproduce</h2>
<p dir="auto">Create a new Flutter plugin project :</p>
<ol dir="auto">
<li>
<p dir="auto"><code class="notranslate">flutter create --template=plugin -i swift sample</code></p>
</li>
<li>
<p dir="auto">In sample/example/ios/Podfile, Comment <code class="notranslate">use_frameworks!</code></p>
</li>
<li>
<p dir="auto">In sample/example run <code class="notranslate">flutter run</code> on iOS emulator</p>
</li>
<li></li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fatal error: 'sample/sample-Swift.h' file not found
#import &lt;sample/sample-Swift.h&gt;"><pre class="notranslate"><code class="notranslate">fatal error: 'sample/sample-Swift.h' file not found
#import &lt;sample/sample-Swift.h&gt;
</code></pre></div>
<h2 dir="auto">Logs</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="flutter doctor -v
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale fr-FR)
    • Flutter version 1.0.0 at /Users/romainpardon/Development/SDK/flutter
    • Framework revision 5391447fae (3 weeks ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/romainpardon/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.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-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 31.3.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

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

[✓] Connected device (1 available)
    • iPhone XR • DDB601C1-5AEC-47B3-999A-2D6E72FAF466 • ios • iOS 12.1 (simulator)

• No issues found!"><pre class="notranslate"><code class="notranslate">flutter doctor -v
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale fr-FR)
    • Flutter version 1.0.0 at /Users/romainpardon/Development/SDK/flutter
    • Framework revision 5391447fae (3 weeks ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/romainpardon/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.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-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 31.3.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

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

[✓] Connected device (1 available)
    • iPhone XR • DDB601C1-5AEC-47B3-999A-2D6E72FAF466 • ios • iOS 12.1 (simulator)

• No issues found!
</code></pre></div>