android - 我无法从 gitlab 存储库中发布包含两个包的包

标签 android ios flutter dart

版本
发布 2.11.0-174.0.dev
重现步骤
我 fork 了一个发布到 dartpub 的包。
DartPub
GitLab
此包包含 twilio_programmable_videotwilio_programmable_video_platform_interface .twilio_programmable_video取决于 twilio_programmable_video_platform_interface通过相对路径在存储库中。
树是这样的。

packages
    ├ packageA
        └ pubspec.yaml
    └ packageB
        └ pubspec.yaml
我重写 pubspec.yaml如下。
dependency_overrides:
  twilio_programmable_video_platform_interface:
    git:
      url: ssh://git@gitlab.com/myname/programmable-video.git
      ref: master
      path: programmable_video_platform_interface
  twilio_programmable_video:
    git:
      url: ssh://git@gitlab.com/myname/programmable-video.git
      ref: master
      path: programmable_video
然后我尝试 flutter pub get并因以下错误而失败。
Error on line 17, column 11: Invalid description in the "twilio_programmable_video" pubspec on the "twilio_programmable_video_platform_interface" dependency: "../programmable_video_platform_interface" is a relative path, but this isn't a local pubspec.
   ╷
17 │     path: ../programmable_video_platform_interface
   │           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
pub get failed (65;    ╵)
我的 pubspec.yaml是错的?
有没有另一种正确写法的方法?
预期结果:flutter pub get顺利完成。
实际结果:flutter pub get 时发生错误.

日志
$ flutter pub get


Error on line 17, column 11: Invalid description in the "twilio_programmable_video" pubspec on the "twilio_programmable_video_platform_interface" dependency: "../programmable_video_platform_interface" is a relative path, but this isn't a local pubspec.
   ╷
17 │     path: ../programmable_video_platform_interface
   │           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
pub get failed (65;    ╵)

编辑 (2021-01-29 16:40:00)
我想从我的 gitlab 存储库中获取一个包。
我试图获得以下规范。
dependencies:
  flutter:
    sdk: flutter

  twilio_programmable_video_platform_interface:
    git:
      url: ssh://git@gitlab.com/myname/programmable-video.git
      ref: master
      path: programmable_video_platform_interface
  twilio_programmable_video:
    git:
      url: ssh://git@gitlab.com/myname/programmable-video.git
      ref: master
      path: programmable_video
但我得到了同样的错误。
Error on line 17, column 11: Invalid description in the "twilio_programmable_video" pubspec on the "twilio_programmable_video_platform_interface" dependency: "../programmable_video_platform_interface" is a relative path, but this isn't a local pubspec.
   ╷
17 │     path: ../programmable_video_platform_interface
   │           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
pub get failed (65;    ╵)

最佳答案

看起来您正试图在依赖项覆盖中覆盖包依赖项。如果是,您应该提供 twilio_programmable_video_platform_interface 和 twilio_programmable_video 存储库的绝对/相对路径。
如果你想在你的项目中直接使用 github repos,你需要在 dependencies 下而不是在 dependency_overrides 下指定它们。

Snippet from pubspec.yaml:

dependencies:
  flutter:
    sdk: flutter
  built_value: ^7.1.0
  packageA:
    git:
      url: git@bitbucket.org:pkg/packageA.git
      ref: master
# Incase you want to override the above usage and instead use the repo on 
# your local machine, you can specify the path of the repo under 
# dependency_overrides.

dependency_overrides:
  analyzer: ^0.41.1
  packageA:
    path: /Users/nbm/Downloads/Projects/Flutter/pkg/packageA

关于android - 我无法从 gitlab 存储库中发布包含两个包的包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65936223/

相关文章:

android - 如何用测试数据测试一个ListActivity?

ios - 无法将 UIImageView 拖到 UIScrollview 的末尾?

ios - 如何从另一个函数更新单元格图像?

flutter - 如何在 Flutter DataColumn 小部件中将标签居中?

flutter - Hive Flutter 用法

android - Android 支持非英文字符

android - 捕获 android 应用程序 http 流量

android - 为什么fragment恢复后又调用了onLoadFinished?

ios - 如何创建有线可循的室内导航?

java - Flutter - 将 Java 例程转换为 flutter