flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
164.8k stars 27.16k forks source link

All plugins are grabbed with Implementation rathar than Api which prevents accessing the plugin from existing apps #23822

Open shehabic opened 5 years ago

shehabic commented 5 years ago

Steps to Reproduce

TLDR;

More details

  1. Create any flutter plugin e.g. a plugin that will always ask your existing app for data.
  2. Assume that the heavy functionality of the collecting data is already in your Existing App.
  3. Assume for that purpose you decided to add a listener in your native implementaion for your plugin on both Android and iOS, such that everytime a message arrives from your communication channel you ask the existing app via the listener registered to answer requests
  4. Assume that you're importing this plugin through flutter module (The standard way), and your module has dependencies to many plugins.
  5. Your app will only see code implemented in the flutter-module, but not any of the plugins.
  6. The problem is at this point. https://github.com/flutter/flutter/blob/master/packages/flutter_tools/gradle/flutter.gradle#L187 the following change solves the problem:
    api pluginProject
[✓] Flutter (Channel master, v0.10.2-pre.131, on Mac OS X 10.14 18A391, locale en-DE)
    • Flutter version 0.10.2-pre.131 at /Users/m.osman/development/flutter
    • Framework revision 01c7081565 (8 hours ago), 2018-10-31 21:12:51 -0700
    • Engine revision c79faed71c
    • Dart version 2.1.0 (build 2.1.0-dev.8.0 bf26f760b1)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/m.osman/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 2.0.0
    • CocoaPods version 1.5.3

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

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

[!] Connected device
    ! No devices available
zoechi commented 5 years ago

22117 sounds related

shehabic commented 5 years ago

@zoechi Not exactly, as a general context it's about Plugins yes, but this one is just about how we add plugins into the module, I'll think about creating a PR with an option that if specified on the module level maybe add plugin modules using api and alternatively adds them as implementation, but still haven't figured out where exactly to introduce this config.

gaaclarke commented 4 years ago

cc @blasten This sounds like a gradle issue. Want to take a look?