[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widget_test problem #4250

Closed
acendre opened this issue Jun 21, 2020 · 15 comments
Closed

Widget_test problem #4250

acendre opened this issue Jun 21, 2020 · 15 comments
Labels
a.tut.codelab-google Relates to codelabs hosted on codelabs.developers.google.com e1-hours Effort: < 8 hrs p2-medium Necessary but not urgent concern. Resolve when possible.

Comments

@acendre
Copy link
acendre commented Jun 21, 2020

I was doing the tutorial for the cupertino AppStore when errors appears and don't know how to resolve it. I just copied code from GitHub file but it's doesn't work. I'm on Mac and using [VScode.
Capture d’écran 2020-06-21 à 23 34 56
Thank in advance

@sfshaza2
Copy link
Contributor

@domesticmouse

@sfshaza2 sfshaza2 added a.tut.codelab-google Relates to codelabs hosted on codelabs.developers.google.com e1-hours Effort: < 8 hrs p2-medium Necessary but not urgent concern. Resolve when possible. labels Jun 22, 2020
@domesticmouse
Copy link
Contributor

Looks like VSCode has failed to correctly check out dependencies. I'd shutdown VSCode, confirm the code works from the command line with flutter run and then open up VSCode again on the specific step you are interested in.

I've found VSCode can be a bit iffy with checkouts that contain multiple flutter projects.

@domesticmouse
Copy link
Contributor

/cc @DanTup this might be of interest to you. =)

@DanTup
Copy link
Contributor
DanTup commented Jun 23, 2020

I'm not familiar with the project mentioned here - is there a repo/document I can try out to see if I can repro?

Generally when opening a new project that has no .packages file, there should be a prompt to run pub get like this:

Screenshot 2020-06-23 at 09 28 02

VS Code will collapse these notifications after some time (10 seconds?) though (something we can't control) so if you miss it, you'll have issues like this until you manually run Dart: Get Packages from the VS Code Command prompt or click the bell icon in the bottom right corner and run it from the collapsed notification.

If you modify the pubspec.yaml, pub get should be run automatically by default.

If you see situations where any of this might not be working reliably, do file issues at https://github.com/Dart-Code/Dart-Code with as much info as you can that might help reproduce it. Thanks!

@domesticmouse
Copy link
Contributor

@DanTup the repository in question is https://github.com/googlecodelabs/flutter-cupertino-store

I just tried it myself against VSCode Version: 1.46.1 with Flutter 3.11.0 and it indeed shows the Get packages pop up. The various projects show as red until flutter pub get has been run by VSCode in each step sub directory.

@acendre can you replicate?

@acendre
Copy link
Author
acendre commented Jun 23, 2020

Hello !
Thanks for answering so fast. I did what you suggested but it didn't work.

I will detail what I have and what I did to have this.

@acendre
Copy link
Author
acendre commented Jun 23, 2020

Sorry if I'm not that familiar with Git process but I'm new to it.
VScode Version: 1.46.1
Where did you see Flutter version ? It's recent

I just downloaded the project, put it in my developement repository where flutter repo is. Then launch VScode and open the project cupertino_store. Then I did flutter pub get or/and package get. It didn't change errors that much. (PS : I already achieve to create the app "start_up").

@DanTup
Copy link
Contributor
DanTup commented Jun 24, 2020

@acendre if you run flutter analyze from the terminal in the same folder, do you see the same errors reported?

@acendre
Copy link
Author
acendre commented Jun 30, 2020

Yes exactly the same ...

flutter pub get and packages get are the same command ?

@DanTup
Copy link
Contributor
DanTup commented Jun 30, 2020

Yep, they're the same command. For the project (or one of the projects) that are showing errors like this, is there a .packages file in the root of the project? Does it contain a line for flutter_test?

@acendre
Copy link
Author
acendre commented Jun 30, 2020

Yes, there is file .packages :
Capture d’écran 2020-06-30 à 16 38 16

@DanTup
Copy link
Contributor
DanTup commented Jun 30, 2020

@acendre can you check you have this in your pubspec.yaml?

dev_dependencies:
  flutter_test:
    sdk: flutter

I think it's probably missing. It should be in the default pubpsec.yaml created by the Flutter: New Project command.

@acendre
Copy link
Author
acendre commented Jun 30, 2020

Ok thank you, it's good now. Does it exist processes to follow into avoiding that manipulation when we open an existing project ?

@DanTup
Copy link
Contributor
DanTup commented Jun 30, 2020

@acendre I'm not sure how you ended up without that dependency. It's included automatically when you create a project with flutter create or Flutter: New Project. Is it possible you accidentally removed it while modifying the pubspec.yaml? Or did you build the project manually from following some instructions? (in which case, maybe they are missing this?).

@domesticmouse
Copy link
Contributor

Closing this out as the debugging conversation appears to have gone stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a.tut.codelab-google Relates to codelabs hosted on codelabs.developers.google.com e1-hours Effort: < 8 hrs p2-medium Necessary but not urgent concern. Resolve when possible.
Projects
None yet
Development

No branches or pull requests

4 participants