You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support publishing a plugin so that others can consume it (#7816).
A plugin consists of three pieces:
A plugin interface written in dart, which sends and receives HostMessages
Android specific code (java) which responds to HostMessages and interfaces with the native Android platform
iOS specific code (ojb-c or swift) which responds to HostMessages and interfaces with the native iOS platform
We assume that parts 2. and 3. is published on their existing distribution mechanisms, specifically mavencentral for java code and cocoapods for obj-c/swift code, and that some manifest is provided for declaring a dependency on those artifacts.
The functionality needed to actually build a plugin that depends on binaries in mavencentral/cocoapods is tracked in #7813.
We assume that parts 2. and 3. is published on their existing distribution mechanisms, specifically mavencentral for java code and cocoapods for obj-c/swift code, and that some manifest is provided for declaring a dependency on those artifacts.
disclaimer: dunno how iOS works
Regarding Android I'd also really like to be able to use java code without publishing to maven-central because some company may not want to publish their sources that are used to build flutter apps and because it's not as easy as pub to publish to maven-central.
It could perhaps be possible to have a plugin structure with the java code where a maven local install will be perform before running the app (with mvn clean install in /plugin/flutter/android regarding the following structure).
Hi @a14n, yes totally get the use case where you have a plugin with code that you prefer not / are not able to publish. It's still early, and we don't have all the details figured out, but we hope to still support that use case! It's covered in these two separate issues: #7812, #7811.
Note though, the such plugins will be considered private, cannot be published to others, and you would need to handle the distribution of the source code yourself (e.g., in a source control system).
Android: The native part of the plugin is a Gradle project. In the plugin template, there will be source code here, but you don't have to have it. You could also just depend on binary artifacts, either from Maven Central, or shipped with the plugin.
iOS: The native part of the plugin is a Pod. In the plugin template, there will be source code, but again, you don't have to have it. You could set up the Podspec to depend on other Pods, or include a vendored binary framework.
This should cover all the use cases, but hasn't been fully tested yet. Plus, the new plugin template hasn't landed.
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 -v and a minimal reproduction of the issue.
Activity
a14n commentedon Feb 3, 2017
disclaimer: dunno how iOS works
Regarding Android I'd also really like to be able to use java code without publishing to maven-central because some company may not want to publish their sources that are used to build flutter apps and because it's not as easy as pub to publish to maven-central.
It could perhaps be possible to have a plugin structure with the java code where a maven local install will be perform before running the app (with
mvn clean installin/plugin/flutter/androidregarding the following structure).Thus the plugin could also be self contained.
wdyt?
mit-mit commentedon Feb 3, 2017
Hi @a14n, yes totally get the use case where you have a plugin with code that you prefer not / are not able to publish. It's still early, and we don't have all the details figured out, but we hope to still support that use case! It's covered in these two separate issues: #7812, #7811.
Note though, the such plugins will be considered private, cannot be published to others, and you would need to handle the distribution of the source code yourself (e.g., in a source control system).
jakobr-google commentedon Mar 23, 2017
Here's what's being implemented:
Android: The native part of the plugin is a Gradle project. In the plugin template, there will be source code here, but you don't have to have it. You could also just depend on binary artifacts, either from Maven Central, or shipped with the plugin.
iOS: The native part of the plugin is a Pod. In the plugin template, there will be source code, but again, you don't have to have it. You could set up the Podspec to depend on other Pods, or include a vendored binary framework.
This should cover all the use cases, but hasn't been fully tested yet. Plus, the new plugin template hasn't landed.
jakobr-google commentedon Mar 30, 2017
Plugin template landed in #9076. Now we just need to build a plugin and prove that we can publish (and consume) it.
jakobr-google commentedon Apr 18, 2017
@szakarias is working on building and publishing a plugin, which will validate this workflow.
szakarias commentedon Apr 21, 2017
The url_launcher plugin has been published on pub: https://pub.dartlang.org/packages/url_launcher
github-actions commentedon Sep 5, 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.