如何将fork github包添加到pubspec.yaml? [英] How to add a fork github package to the pubspec.yaml?

查看:100
本文介绍了如何将fork github包添加到pubspec.yaml?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

map_view插件不再维护,如果最小sdk达到28,将使用户遇到问题,因此幸运的是Eimji派生了该软件包的修改版本,但仅在github

map_view plugin is no longer maintained and let users with problems if the min sdk is up to 28, so luckily Eimji fork a modified version of the package but it's only on github https://github.com/Eimji/flutter_google_map_view and not on https://pub.dartlang.org I search to add his fork to my pubspec.yaml.

我尝试了

flutter_google_map_view:
       git://github.com/Eimji/flutter_google_map_view.git

谢谢

更新

我通过map_view更改了名称,似乎已经接受了... 但是当我使用flutter_google_map_view时

I changed name by map_view it seems accepted ... but when I use flutter_google_map_view I have

Error on line 1, column 7 of flutter_google_map_view\pubspec.yaml: "name" field doesn't match expected name "flutter_google_map_view".

我不知道为什么map_view可以工作",但为什么mapview不起作用...所以我不知道它是否真的被接受或很好的方法...

I don't know why map_view "works" but not mapview ...So I don't know if it's really accepted or the great methode ...

所以现在当我上传本地map_view程序包时还有其他问题...

So now I have other issue when I upload my local map_view package ...

* Error running Gradle:
Exit code 1 from: C:\Users\utilisateur\AndroidStudioProjects\nirbi\android\gradlew.bat app:properties:
WARNING: The specified Android SDK Build Tools version (25.0.3) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.2.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING: The specified Android SDK Build Tools version (25.0.3) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.2.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING: The specified Android SDK Build Tools version (25.0.3) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.2.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':map_view'.
> Failed to notify project evaluation listener.
   > java.lang.AbstractMethodError (no error message)

我从build.gradle文件中搜索buildToolsVersion '25 .0.3,但没有这样的东西.因此,我在build.gradle中添加了buildToolsVersion '28 .0.3',但始终有相同的错误...

I search buildToolsVersion '25.0.3 from my build.gradle file , but nothing like this. So I add buildToolsVersion '28.0.3' in build.gradle but have always the same error ...

更新

我删除了所有似乎正常的"buildToolsVersion '25 .0.3'",现在我遇到了最后一个问题:

I remove all "buildToolsVersion '25.0.3'" it seem working and now I have this last issue :

* Error running Gradle:
Exit code 1 from: C:\Users\utilisateur\AndroidStudioProjects\nirbi\android\gradlew.bat app:properties:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':map_view'.
> Failed to notify project evaluation listener.
   > java.lang.AbstractMethodError (no error message)

我认为map_view没有被正确接受...

I think map_view is not correctly accepted ...

更新 一些简单建议将此github包 https://github.com/Eimji/flutter_google_map_view 导入到pubspec. yaml?

Update Some suggestions to simply import this github package https://github.com/Eimji/flutter_google_map_view to pubspec.yaml ?

当我使用

 flutter_google_map_view:
      git: git://github.com/Eimji/flutter_google_map_view.git

我遇到此错误...

Git error. Command: git clone --mirror git://github.com/munificent/map_view.git C:\Users\utilisateur\AppData\Roaming\Pub\Cache\git\cache\map_view-84b47933c6a730a2f0624a589576e53be480ad60
Cloning into bare repository 'C:\Users\utilisateur\AppData\Roaming\Pub\Cache\git\cache\map_view-84b47933c6a730a2f0624a589576e53be480ad60'...

更新 我尝试了最后的机会!导入map_view:^ 0.0.14(不兼容android X)并手动添加Eimji所做的所有修改

Update I tried my last chance ! import map_view: ^0.0.14 (no compatible android X) and add manualy all modification did by Eimji https://github.com/Eimji/flutter_google_map_view/commit/5b631c499783936dfc462039274a6f5c59323068#diff-7ae5a9093507568eabbf35c3b0665732

我遇到此错误

* Error running Gradle:
Exit code 1 from: C:\Users\utilisateur\AndroidStudioProjects\nirbi\android\gradlew.bat app:properties:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':map_view'.
> Failed to notify project evaluation listener.
   > java.lang.AbstractMethodError (no error message)

推荐答案

请参见 https ://www.dartlang.org/tools/pub/dependencies#git-packages

dependencies:
  kittens:
    git:
      url: git://github.com/munificent/kittens.git
      ref: some-branch

如果pubspec.yaml不在根目录中,您还可以指定路径

If pubspec.yaml is not in the root directory you can also specify a path

dependencies:
  kittens:
    git:
      url: git://github.com/munificent/cats.git
      path: path/to/kittens

这篇关于如何将fork github包添加到pubspec.yaml?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆