Closed nosmirck closed 5 years ago
@nosmirck thanks for opening this issue!
Can you please try with the following pubspec.yaml
and let me know if it works?
name: flutter_todos
description: A new Flutter project.
environment:
sdk: ">=2.0.0 <3.0.0"
dependencies:
meta: ">=1.1.0 <2.0.0"
equatable: ^0.2.0
flutter_bloc: ^0.7.0
flutter:
sdk: flutter
dependency_overrides:
todos_app_core:
git:
url: https://github.com/brianegan/flutter_architecture_samples
path: todos_app_core
todos_repository_core:
git:
url: https://github.com/brianegan/flutter_architecture_samples
path: todos_repository_core
todos_repository_simple:
git:
url: https://github.com/brianegan/flutter_architecture_samples
path: todos_repository_simple
flutter:
uses-material-design: true
Thanks! 👍
Thanks for the fast response @felangel I'm getting the same issue with new pubspec content:
[flutter_todos] flutter packages get
Running "flutter packages get" in flutter_todos...
Error on line 11, column 11: Invalid description in the "todos_repository_simple" pubspec on the "todos_repository_core" dependency: "../todos_repository_core" is a relative path, but this isn't a local pubspec.
╷
11 │ path: ../todos_repository_core
│ ^^^^^^^^^^^^^^^^^^^^^^^^
╵
pub get failed (65)
exit code 65
I just tried cloning the whole bloc
repo, navigated to examples/flutter_todos
and tried flutter packages get
and I got the same error.
@nosmirck oops that's my fault! Just pushed a fix for this. The following pubspec.yaml
should work. Let me know if that helps.
name: flutter_todos
description: A new Flutter project.
environment:
sdk: ">=2.0.0 <3.0.0"
dependencies:
meta: ">=1.1.0 <2.0.0"
equatable: ^0.2.0
flutter_bloc: ^0.7.0
flutter:
sdk: flutter
dependency_overrides:
todos_app_core:
git:
url: https://github.com/brianegan/flutter_architecture_samples
path: todos_app_core
ref: 0d047565ea5bf28c2b2cbdd7a7d9a9d14fff6945
todos_repository_core:
git:
url: https://github.com/brianegan/flutter_architecture_samples
path: todos_repository_core
ref: 0d047565ea5bf28c2b2cbdd7a7d9a9d14fff6945
todos_repository_simple:
git:
url: https://github.com/brianegan/flutter_architecture_samples
path: todos_repository_simple
ref: 0d047565ea5bf28c2b2cbdd7a7d9a9d14fff6945
flutter:
uses-material-design: true
@felangel same error.
I believe the problem is here:
The reference for todos_repository_core on line 11 is a relative path.
@nosmirck did you try the latest pubspec.yaml
?
Yes I did.
PS C:\Repos\flutter_todos> flutter packages get
Error on line 11, column 11: Invalid description in the "todos_repository_simple" pubspec on the "todos_repository_core" dependency: "../todos_repository_core" is a relative path, but this isn't a local pubspec.
╷
11 │ path: ../todos_repository_core
│ ^^^^^^^^^^^^^^^^^^^^^^^^
╵
Running "flutter packages get" in flutter_todos...
pub get failed (65)
@nosmirck did you delete your pubspec.lock
?
I just created a clean project and tested it and it seems to work for me. 🤔
Just did, same error.
Just to confirm:
mkdir tmp
)pubspec.yaml
in tmp (touch tmp/pubspec.yaml
)pubspec.yaml
name: flutter_todos
description: A new Flutter project.
environment:
sdk: ">=2.0.0 <3.0.0"
dependencies:
meta: ">=1.1.0 <2.0.0"
equatable: ^0.2.0
flutter_bloc: ^0.7.0
flutter:
sdk: flutter
dependency_overrides:
todos_app_core:
git:
url: https://github.com/brianegan/flutter_architecture_samples
path: todos_app_core
ref: 0d047565ea5bf28c2b2cbdd7a7d9a9d14fff6945
todos_repository_core:
git:
url: https://github.com/brianegan/flutter_architecture_samples
path: todos_repository_core
ref: 0d047565ea5bf28c2b2cbdd7a7d9a9d14fff6945
todos_repository_simple:
git:
url: https://github.com/brianegan/flutter_architecture_samples
path: todos_repository_simple
ref: 0d047565ea5bf28c2b2cbdd7a7d9a9d14fff6945
flutter:
uses-material-design: true
flutter packages get
You still get the error?
Maybe you have the core on your cache and that's why you don't have the error. Go to your flutter installation folder > .pub-cache/git and delete it's content, then try running flutter packages get
I still have the same error on both of my machines (Mac and Windows)
@nosmirck yeah you're probably right. I just checked and the commit I was referencing should have the same issue. I ended up just moving the repositories into the flutter_todos project since that was the most straightforward solution. Everything should work now if you just pull master 👍
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.
@nosmirck I updated the tutorial to reference the local repositories as well. I'll try to talk to Brian Egan (the owner of the todos_repository) and see if he's okay with making the change to use a git import instead of a relative import but in the meantime at least people who clone and try to run the flutter_todos example won't have any problem.
Perfect! good solution.
I can close this now :) thanks for the help!
@nosmirck Thanks for your help; I really appreciate it!
FYI: I opened https://github.com/brianegan/flutter_architecture_samples/pull/124 to address this 🤞
Target of URI doesn't exist: 'package:flutter_todos/models/models.dart'.
this is what I got
@rahi0 you need to create a barrel file for the model exports.
https://github.com/felangel/bloc/blob/master/examples/flutter_todos/lib/models/models.dart
I’ll update the documentation 👍
hi, still get this issue in 2020. How to resolve this?
@huynguyennovem can you describe the steps you're taking and the error you're getting? Thanks 👍
@huynguyennovem can you describe the steps you're taking and the error you're getting? Thanks 👍
I got the error message same as @nosmirck . After checking this, I see that there is missing todos_repository_simple
in the repository
@huynguyennovem you have the same pubspec.yaml
as https://github.com/felangel/bloc/blob/master/examples/flutter_todos/pubspec.yaml?
@huynguyennovem you have the same
pubspec.yaml
as https://github.com/felangel/bloc/blob/master/examples/flutter_todos/pubspec.yaml?
Yes, I have the same one.
Can you share a link to your repo so I can try to run it locally?
Please check it : https://github.com/huynguyennovem/FlutterTodoAppSample
@huynguyennovem just tried and had no trouble 🤔 Have you tried clearing your pub cache?
@huynguyennovem just tried and had no trouble 🤔 Have you tried clearing your pub cache?
hmm, I tried flutter clean
then get package again. And the result is:
E:\FlutterSDK\flutter\bin\flutter.bat --no-color pub get
Running "flutter pub get" in bloc_todoapp2...
! todos_app_core 0.0.0 from git https://github.com/felangel/flutter_architecture_samples at 71f32b in todos_app_core
! todos_repository_core 0.0.0 from git https://github.com/felangel/flutter_architecture_samples at 71f32b in todos_repository_core
! todos_repository_simple 0.0.0 from git https://github.com/felangel/flutter_architecture_samples at 71f32b in todos_repository_simple
Running "flutter pub get" in bloc_todoapp2... 1.0s
Process finished with exit code 0
@huynguyennovem exit code 0 means everything went well 😊
@huynguyennovem exit code 0 means everything went well 😊
oh, sorry about that and thank for your support!
I have the same problem in another repo and package, fleather I solve it with these steps, (I know it's not logic but it solves it). I understand that the first package depends on the second.
It makes an error: failed Because every version of fleather from git depends on parchment from the path and nodebook_editor depends on parchment from git, fleather from git is forbidden.
it solves the problem.
Describe the bug Following the tutorial for flutter_todos I get the error:
To Reproduce Steps to reproduce the behavior:
flutter create flutter_todos
pubspec.yml
to the following:environment: sdk: ">=2.0.0 <3.0.0"
dependencies: meta: ">=1.1.0 <2.0.0" equatable: ^0.2.0 flutter_bloc: ^0.7.0 flutter: sdk: flutter
dependency_overrides: todos_app_core: git: url: git://github.com/brianegan/flutter_architecture_samples path: todos_app_core todos_repository_core: git: url: git://github.com/brianegan/flutter_architecture_samples path: todos_repository_core todos_repository_simple: git: url: git://github.com/brianegan/flutter_architecture_samples path: todos_repository_simple
flutter: uses-material-design: true
PS C:\Repos\bloc\examples\flutter_todos> flutter analyze Error on line 11, column 11: Invalid description in the "todos_repository_simple" pubspec on the "todos_repository_core" dependency: "../todos_repository_core" is a relative path, but this isn't a local pubspec. ╷ 11 │ path: ../todos_repository_core │ ^^^^^^^^^^^^^^^^^^^^^^^^ ╵ Running "flutter packages get" in flutter_todos... pub get failed (65)
PS C:\Repos\bloc\examples\flutter_todos> flutter doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel master, v1.3.11-pre.40, on Microsoft Windows [Version 10.0.17763.379], locale en-CA) [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3) [√] Android Studio (version 3.3) [√] VS Code [√] VS Code, 64-bit edition (version 1.32.1) [!] Connected device ! No devices available
! Doctor found issues in 1 category. PS C:\Repos\bloc\examples\flutter_todos>