8000 Flutter and non-flutter dependency conflict with "platforms" pubspec key · Issue #2606 · dart-lang/pub · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Flutter and non-flutter dependency conflict with "platforms" pubspec key #2606
Closed as not planned
@vaind

Description

@vaind

Environment

  • pub version or flutter pub version: Pub 2.8.4
  • OS version: Linux 5.4
  • Are you using the Chinese community mirror or a corporate firewall? no

Problem

I'm maintaining a package that supports both "plain" dart native and flutter (ios, android) and wanted to update pubspec to the new format including "platforms".

After adding platforms key to the pubspec.yaml, pub publish prints the following error (see this PR #2265):

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)

OK, so I add flutter to the environment and pub publish works now:

environment:
  sdk: ">=2.6.0 <3.0.0"
  flutter: ">=1.12.0 <2.0.0"

But this change has dropped the non-flutter (plain dart) support so dart-only packages depending on this lib are broken:

$ pub get
Resolving dependencies... 
Because dart_only_app depends on objectbox_flutter_libs from path which requires the Flutter SDK, version solving failed.

Flutter users should run `flutter pub get` instead of `pub get`.

Proposed solution

Change the pub publish error to warning so the package with the platforms key can be publish even if it doesn't specify the dependency on flutter explicitly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-infoAdditional information needed from the issue author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0