how to use this repo from Git in flutter?
fredwilliam opened this issue · 12 comments
i see some things in issues that are resolved but not yet updated in pub.dev so i tried to use this git repo instead without success
can someone help me?
this is how i tried it
form_bloc:
git:
url: git://github.com/GiancarloCode/form_bloc/
Hi, here you have a piece of pubspec
dependencies:
flutter:
sdk: flutter
flutter_bloc: 8.0.0
form_bloc: 0.20.4
flutter_form_bloc: 0.20.4
cupertino_icons: ^1.0.2
#Overridden to newest git version!!!!!!!!--->
dependency_overrides:
form_bloc:
git:
url: https://github.com/GiancarloCode/form_bloc
path: packages/form_bloc
flutter_form_bloc:
git:
url: https://github.com/GiancarloCode/form_bloc
path: packages/flutter_form_bloc
#<---Overridden to newest git version!!!!!!!!
form_bloc: 0.20.4 flutter_form_bloc: 0.20.4
Thanks for the response. I have tried the mentioned and am getting the following error...
Error on line 17, column 11: Invalid description in the "flutter_form_bloc" pubspec on the "form_bloc" dependency: "../form_bloc" is a relative path, but this isn't a local pubspec.
╷
17 │ path: ../form_bloc
│ ^^^^^^^^^^^^
╵
pub get failed (65; ╵)
Did you add this code below dependencies section?
dependency_overrides:
form_bloc:
git:
url: https://github.com/GiancarloCode/form_bloc
path: packages/form_bloc
flutter_form_bloc:
git:
url: https://github.com/GiancarloCode/form_bloc
path: packages/flutter_form_bloc
Thanks for your response here is my pubspec file
name: Research
description: A Very Good Project created by Very Good CLI.
version: 1.0.0+1
publish_to: none
environment:
sdk: ">=2.14.0 <3.0.0"
dependencies:
bloc: ^8.0.2
flutter:
sdk: flutter
flutter_bloc: ^8.0.1
flutter_localizations:
sdk: flutter
intl: ^0.17.0
form_bloc: 0.20.4
flutter_form_bloc: 0.20.4
shared_preferences: ^2.0.12
dio: ^4.0.4
percent_indicator: ^4.0.0
cool_alert: ^1.1.0
dev_dependencies:
bloc_test: ^9.0.2
flutter_test:
sdk: flutter
mocktail: ^0.2.0
very_good_analysis: ^2.4.0
dependency_overrides:
form_bloc:
git:
url: https://github.com/GiancarloCode/form_bloc
path: packages/form_bloc
flutter_form_bloc:
git:
url: https://github.com/GiancarloCode/form_bloc
path: packages/flutter_form_bloc
flutter:
uses-material-design: true
generate: true
https://gist.github.com/julek-kal/507c68e132ae59173784e4ccb2956160
After running this pubspec I don't get an error, only get warning that my dependencies are overidden
So idk maybe you should try copying my code, run flutter clean
and then flutter pub get
I appreciate your support, i have tried to clean and pub get -v here is my log
fred@Freds-MacBook-Pro research % flutter clean
Cleaning Xcode workspace... 8.9s
Deleting build... 1ms
Deleting .dart_tool... 0ms
fred@Freds-MacBook-Pro research %
fred@Freds-MacBook-Pro research % flutter pub get -v
[ +94 ms] executing: sysctl hw.optional.arm64
[ +15 ms] Exit code 1 from: sysctl hw.optional.arm64
[ ] sysctl: unknown oid 'hw.optional.arm64'
[ +6 ms] executing: [/Users/fred/development/flutter/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +24 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] 5f105a6ca7a5ac7b8bc9b241f4c2d86f4188cf5c
[ +1 ms] executing: [/Users/fred/development/flutter/flutter/] git tag --points-at 5f105a6ca7a5ac7b8bc9b241f4c2d86f4188cf5c
[ +36 ms] Exit code 0 from: git tag --points-at 5f105a6ca7a5ac7b8bc9b241f4c2d86f4188cf5c
[ ] 2.10.0
[ +12 ms] executing: [/Users/fred/development/flutter/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +18 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/stable
[ ] executing: [/Users/fred/development/flutter/flutter/] git ls-remote --get-url origin
[ +23 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ +125 ms] executing: [/Users/fred/development/flutter/flutter/] git rev-parse --abbrev-ref HEAD
[ +17 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] stable
[ +6 ms] executing: sw_vers -productName
[ +22 ms] Exit code 0 from: sw_vers -productName
[ ] macOS
[ ] executing: sw_vers -productVersion
[ +20 ms] Exit code 0 from: sw_vers -productVersion
[ +1 ms] 11.6
[ ] executing: sw_vers -buildVersion
[ +24 ms] Exit code 0 from: sw_vers -buildVersion
[ ] 20G165
[ +91 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +58 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[ ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[ +145 ms] Initializing file store
[ +14 ms] gen_localizations: Starting due to {}
[ +148 ms] gen_localizations: Complete
[ +16 ms] Persisting file store
[ +3 ms] Done persisting file store
[ +21 ms] Running "flutter pub get" in research...
[ +6 ms] Using /Users/fred/development/flutter/flutter/.pub-cache for the pub cache.
[ +1 ms] executing: [/Users/fred/StudioProjects/research/] /Users/fred/development/flutter/flutter/bin/cache/dart-sdk/bin/dart __deprecated_pub --verbose get --no-precompile
[ +298 ms] FINE: Pub 2.16.0
[ +81 ms] MSG : Resolving dependencies...
[ +99 ms] SLVR: fact: research is 1.0.0+1
[ +6 ms] SLVR: derived: research
[ +34 ms] SLVR: fact: research depends on bloc ^8.0.2
[ ] SLVR: fact: research depends on flutter from sdk
[ ] SLVR: fact: research depends on flutter_bloc ^8.0.1
[ ] SLVR: fact: research depends on flutter_localizations from sdk
[ ] SLVR: fact: research depends on intl ^0.17.0
[ ] SLVR: fact: research depends on shared_preferences ^2.0.12
[ ] SLVR: fact: research depends on dio ^4.0.4
[ ] SLVR: fact: research depends on percent_indicator ^4.0.0
[ ] SLVR: fact: research depends on cool_alert ^1.1.0
[ ] SLVR: fact: research depends on bloc_test ^9.0.2
[ ] SLVR: fact: research depends on flutter_test from sdk
[ ] SLVR: fact: research depends on mocktail ^0.2.0
[ ] SLVR: fact: research depends on very_good_analysis ^2.4.0
[ ] SLVR: fact: research depends on form_bloc from git
[ ] SLVR: fact: research depends on flutter_form_bloc from git
[ +3 ms] SLVR: selecting research
[ +1 ms] SLVR: derived: flutter_form_bloc from git
[ +1 ms] SLVR: derived: form_bloc from git
[ ] SLVR: derived: very_good_analysis ^2.4.0
[ ] SLVR: derived: mocktail ^0.2.0
[ ] SLVR: derived: flutter_test from sdk
[ ] SLVR: derived: bloc_test ^9.0.2
[ ] SLVR: derived: cool_alert ^1.1.0
[ ] SLVR: derived: percent_indicator ^4.0.0
[ ] SLVR: derived: dio ^4.0.4
[ ] SLVR: derived: shared_preferences ^2.0.12
[ ] SLVR: derived: intl ^0.17.0
[ ] SLVR: derived: flutter_localizations from sdk
[ ] SLVR: derived: flutter_bloc ^8.0.1
[ ] SLVR: derived: flutter from sdk
[ ] SLVR: derived: bloc ^8.0.2
[ +49 ms] IO : Spawning "git --version" in /Users/fred/StudioProjects/research/.
[ +31 ms] IO : Finished git. Exit code 0.
[ ] | stdout:
[ ] | | git version 2.30.1 (Apple Git-130)
[ ] | Nothing output on stderr.
[ ] FINE: Determined git command git.
[ +4 ms] IO : Spawning "git rev-parse --is-inside-git-dir" in /Users/fred/development/flutter/flutter/.pub-cache/git/cache/form_bloc-46c764c674107accfb9d7645635164273584561e
[ +65 ms] IO : Finished git. Exit code 0.
[ ] | stdout:
[ ] | | true
[ ] | Nothing output on stderr.
[ +1 ms] IO : Spawning "git fetch" in /Users/fred/development/flutter/flutter/.pub-cache/git/cache/form_bloc-46c764c674107accfb9d7645635164273584561e
[+1688 ms] IO : Finished git. Exit code 0.
[ ] | Nothing output on stdout.
[ ] | Nothing output on stderr.
[ ] IO : Spawning "git rev-list --max-count=1 HEAD" in /Users/fred/development/flutter/flutter/.pub-cache/git/cache/form_bloc-46c764c674107accfb9d7645635164273584561e
[ +23 ms] IO : Finished git. Exit code 0.
[ ] | stdout:
[ ] | | 8564436
[ ] | Nothing output on stderr.
[ +7 ms] IO : Spawning "git show 8564436:packages/flutter_form_bloc/pubspec.yaml" in
/Users/fred/development/flutter/flutter/.pub-cache/git/cache/form_bloc-46c764c674107accfb9d7645635164273584561e
[ +34 ms] IO : Finished git. Exit code 0.
[ ] | stdout:
[ ] | | name: flutter_form_bloc
[ ] | | description: Create Beautiful Forms in Flutter. The easiest way to Prefill, Async Validation, Update Form Fields, and Show Progress, Failures or Navigate by Reacting to the Form State.
[ ] | | version: 0.29.3
[ ] | | homepage: https://github.com/GiancarloCode/form_bloc/tree/master/packages/flutter_form_bloc
[ ] | | repository: https://github.com/GiancarloCode/form_bloc/tree/master/packages/flutter_form_bloc
[ ] | | issue_tracker: https://github.com/GiancarloCode/form_bloc/issues
[ ] | |
[ ] | | environment:
[ ] | | sdk: '>=2.12.0 <3.0.0'
[ ] | |
[ ] | | dependencies:
[ ] | | flutter:
[ ] | | sdk: flutter
[ ] | |
[ ] | | flutter_bloc: ^8.0.0
[ ] | | form_bloc:
[ ] | | path: ../form_bloc
[ ] | | # form_bloc: ^0.29.1
[ ] | | equatable: ^2.0.3
[ ] | | rxdart: ^0.27.3
[ ] | | flutter_keyboard_visibility: ^5.0.2
[ ] | | collection: ^1.15.0
[ ] | | intl: ^0.17.0
[ ] | |
[ ] | | dev_dependencies:
[ ] | | flutter_test:
[ ] | | sdk: flutter
[ ] | |
[ ] | | flutter_lints: ^1.0.4
[ ] | Nothing output on stderr.
[ +15 ms] IO : Spawning "git rev-list --max-count=1 HEAD" in /Users/fred/development/flutter/flutter/.pub-cache/git/cache/form_bloc-46c764c674107accfb9d7645635164273584561e
[ +38 ms] IO : Finished git. Exit code 0.
[ ] | stdout:
[ ] | | 8564436
[ +1 ms] | Nothing output on stderr.
[ +5 ms] IO : Spawning "git show 8564436:packages/form_bloc/pubspec.yaml" in
/Users/fred/development/flutter/flutter/.pub-cache/git/cache/form_bloc-46c764c674107accfb9d7645635164273584561e
[ +37 ms] IO : Finished git. Exit code 0.
[ ] | stdout:
[ ] | | name: form_bloc
[ ] | | description: 'Easy Form State Management using BLoC pattern. Separate the Form State and Business Logic from the User Interface. Async Validation, Progress, Dynamic fields, and more.'
[ ] | | version: 0.29.0
[ ] | | homepage: 'https://github.com/GiancarloCode/form_bloc/tree/master/packages/form_bloc'
[ ] | | repository: 'https://github.com/GiancarloCode/form_bloc/tree/master/packages/form_bloc'
[ ] | | issue_tracker: 'https://github.com/GiancarloCode/form_bloc/issues'
[ ] | |
[ ] | | environment:
[ ] | | sdk: '>=2.14.0 <3.0.0'
[ ] | |
[ ] | | dependencies:
[ ] | | meta: ^1.7.0
[ ] | | bloc: ^8.0.1
[ ] | | rxdart: ^0.27.3
[ ] | | equatable: ^2.0.3
[ ] | | collection: ^1.15.0
[ ] | | uuid: ^3.0.4
[ ] | |
[ ] | | dev_dependencies:
[ ] | | test: ^1.20.1
[ ] | | mocktail: ^0.2.0
[ ] | | bloc_test: ^9.0.2
[ ] | | fire_line_diff: ^1.5.3
[ ] | |
[ ] | | lints: ^1.0.1
[ ] | Nothing output on stderr.
[ +7 ms] IO : Spawning "git show 8564436:packages/flutter_form_bloc/pubspec.yaml" in
/Users/fred/development/flutter/flutter/.pub-cache/git/cache/form_bloc-46c764c674107accfb9d7645635164273584561e
[ +36 ms] IO : Finished git. Exit code 0.
[ ] | stdout:
[ ] | | name: flutter_form_bloc
[ ] | | description: Create Beautiful Forms in Flutter. The easiest way to Prefill, Async Validation, Update Form Fields, and Show Progress, Failures or Navigate by Reacting to the Form State.
[ ] | | version: 0.29.3
[ ] | | homepage: https://github.com/GiancarloCode/form_bloc/tree/master/packages/flutter_form_bloc
[ ] | | repository: https://github.com/GiancarloCode/form_bloc/tree/master/packages/flutter_form_bloc
[ ] | | issue_tracker: https://github.com/GiancarloCode/form_bloc/issues
[ ] | |
[ ] | | environment:
[ ] | | sdk: '>=2.12.0 <3.0.0'
[ ] | |
[ ] | | dependencies:
[ ] | | flutter:
[ ] | | sdk: flutter
[ ] | |
[ ] | | flutter_bloc: ^8.0.0
[ ] | | form_bloc:
[ ] | | path: ../form_bloc
[ ] | | # form_bloc: ^0.29.1
[ ] | | equatable: ^2.0.3
[ ] | | rxdart: ^0.27.3
[ ] | | flutter_keyboard_visibility: ^5.0.2
[ ] | | collection: ^1.15.0
[ ] | | intl: ^0.17.0
[ ] | |
[ ] | | dev_dependencies:
[ ] | | flutter_test:
[ ] | | sdk: flutter
[ ] | |
[ ] | | flutter_lints: ^1.0.4
[ ] | Nothing output on stderr.
[ +23 ms] SLVR: Version solving took 0:00:02.147667 seconds.
[ ] | Tried 1 solutions.
[ +2 ms] FINE: Resolving dependencies finished (2.250s).
[ +55 ms] ERR : Error on line 17, column 11: Invalid description in the "flutter_form_bloc" pubspec on the "form_bloc" dependency: "../form_bloc" is a relative path, but this isn't a local pubspec.
[ +1 ms] | ╷
[ ] | 17 │ path: ../form_bloc
[ ] | │ ^^^^^^^^^^^^
[ ] | ╵
[ ] FINE: Exception type: PubspecException
[ +38 ms] FINE: package:pub/src/pubspec.dart 629:5 Pubspec._error
[ ] | package:pub/src/pubspec.dart 623:7 Pubspec._wrapFormatException
[ ] | package:pub/src/pubspec.dart 484:17 Pubspec._parseDependencies.
[ ] | dart:collection MapView.forEach
[ ] | package:pub/src/pubspec.dart 431:16 Pubspec._parseDependencies
[ ] | package:pub/src/pubspec.dart 87:7 Pubspec.dependencies
[ ] | package:pub/src/solver/package_lister.dart 265:63 PackageLister.incompatibilitiesFor
[ ] | ===== asynchronous gap ===========================
[ ] | dart:async Future.catchError
[ ] | package:pub/src/utils.dart 109:52 captureErrors.wrappedCallback
[ ] | package:stack_trace Chain.capture
[ ] | package:pub/src/utils.dart 122:11 captureErrors
[ ] | package:pub/src/command.dart 180:13 PubCommand.run
[ ] | package:args/command_runner.dart 209:27 CommandRunner.runCommand
[ ] | package:pub/src/command_runner.dart 173:24 PubCommandRunner.runCommand
[ ] | package:pub/src/command_runner.dart 158:20 PubCommandRunner.run
[ ] | package:dartdev/dartdev.dart 46:56 runDartdev
[ ] | /opt/s/w/ir/cache/builder/sdk/pkg/dartdev/bin/dartdev.dart 11:9 main
[ +69 ms] Running "flutter pub get" in research... (completed in 2,793ms)
[ +1 ms] "flutter get" took 3,266ms.
[ +4 ms] pub get failed (65; | /opt/s/w/ir/cache/builder/sdk/pkg/dartdev/bin/dartdev.dart 11:9 main)
[ ]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 _DefaultPub.batch (package:flutter_tools/src/dart/pub.dart:373:7)
#2 _DefaultPub.get (package:flutter_tools/src/dart/pub.dart:254:7)
#3 PackagesGetCommand._runPubGet (package:flutter_tools/src/commands/packages.dart:142:7)
#4 PackagesGetCommand.runCommand (package:flutter_tools/src/commands/packages.dart:176:5)
#5 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
#6 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19)
#7 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
#8 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
#9 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19)
#10 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
#11 run.. (package:flutter_tools/runner.dart:62:9)
#12 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19)
#13 main (package:flutter_tools/executable.dart:94:3)
[ +269 ms] ensureAnalyticsSent: 253ms
[ ] Running shutdown hooks
[ ] Shutdown hooks complete
[ ] exiting with code 65
Can you try without form_bloc
and flutter_form_bloc
in dependencies
?
Here they had similar problem felangel/bloc#151
I can not find exactly how to resolve since the mentioned solution link is no longer available
https://github.com/felangel/bloc/issues/151#issuecomment-474032252
Great! flutter_todos from bloc repo works, but creating from scratch (like the tutorial) still presents the issue with the pubspec.
The problem is here: https://github.com/brianegan/flutter_architecture_samples/blob/master/todos_repository_simple/pubspec.yaml
Make the dependency relative to the git url, that should fix it.
Did you tried to remove pubspec.lock, before running flutter pub get
?
If yes, I give up🏳️ I can't think of anything else than create a fork with changed dependencies.
I appreciate your support, i tried delete pubspec.lock without success so i had to clone separately form bloc repo and reference like this for now
flutter_form_bloc:
path: ../form_bloc/packages/flutter_form_bloc
this has worked. Maybe after update is done on pub.dev i will switch then.
Thank you for your time, really appreciate!!