Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a fork github package to the pubspec.yaml?

Tags:

github

flutter

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.

I tried

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

Thank you

Update

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".

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 ...

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)

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 ...

Update

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)

I think map_view is not correctly accepted ...

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

when I use

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

I have this error ...

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'...

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

I have this error

* 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)
like image 699
Nitneuq Avatar asked Mar 22 '19 12:03

Nitneuq


People also ask

How do you fork a flutter package?

Step 1: Find the pub package you want to modify. Step 2: Go to the git repository of that package. Step 3: Fork Repository (you need to log in with your git account on Github). On clicking the fork button, it will create a repository in your GitHub account.

What is the command for getting dependencies listed in the Pubspec yaml?

Get is one of the commands of the pub tool. This command gets all the dependencies listed in the pubspec. yaml file in the current working directory, as well as their transitive dependencies.


1 Answers

See https://www.dartlang.org/tools/pub/dependencies#git-packages

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

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
like image 112
Günter Zöchbauer Avatar answered Sep 23 '22 18:09

Günter Zöchbauer