-
Notifications
You must be signed in to change notification settings - Fork 232
Open
Labels
type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
I was under the impression that we could publish Flutter plugins that also run in Dart standalone (ignoring the Flutter plugin code) by a pubspec with:
name: mylib_source
description: A new Flutter FFI plugin project.
version: 0.0.1
homepage:
environment:
sdk: ">=2.17.0 <3.0.0"
# no flutter:
dependencies:
dev_dependencies:
flutter:
plugin:
platforms:
android:
package: com.example.mylib_source
ffiPlugin: true
ios:
ffiPlugin: true
macos:
ffiPlugin: true
linux:
ffiPlugin: true
windows:
ffiPlugin: true
This works locally with both the Flutter and Dart standalone SDK. (For example dart pub get && dart test
and flutter pub get && flutter test
, where dart
is not from the Flutter SDK.)
However, pub
does not support publishing this:
$ dart pub publish --dry-run
// ...
Package validation found the following error:
* pubspec.yaml allows Flutter SDK version 1.9.x, which does not support the flutter.plugin.platforms key.
Please consider increasing the Flutter SDK requirement to ^1.10.0 (environment.sdk.flutter)
See https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin
Sorry, your package is missing a requirement and can't be published yet.
For more information, see: https://dart.dev/tools/pub/cmd/pub-lish.
Adding the flutter key makes dart pub get
fail:
Resolving dependencies...
Because jni requires the Flutter SDK, version solving failed.
Flutter users should run `flutter pub get` instead of `dart pub get`.
As far as I can see, the only workaround is to publish two packages.
edit: duplicate of #2606
dnys1, HosamHasanRamadan, lukepighetti, Levi-Lesches, rainyl and 2 more
Metadata
Metadata
Assignees
Labels
type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug