Describe the bug
Following the tutorial for flutter_todos I get the error:
[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
To Reproduce
Steps to reproduce the behavior:
flutter create flutter_todospubspec.yml to the following: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: 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
flutter packages getExpected behavior
Get all packages with no errors
*Logs *
flutter analyze output:
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)
flutter doctor output:
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>
@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.yamlname: 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 getYou 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.yamlas 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!
Most helpful comment
oh, sorry about that and thank for your support!