hey guys i have error after using command : flutter pub run build_runner build
error message :
C:\Users\matin\AndroidStudioProjects\mosito>flutter pub run build_runner build
Could not find a file named "pubspec.yaml" in "C:\Users\matin\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\async-2.8.1".
pub finished with exit code 66
i try flutter pub upgrade and a lot of things from google but problem not fixed
NOTE: im new to flutter i want use this command for making .g.dart file for my models thanks for your attention
I think may be you are not in your project directory. Suppose you have a project name A in myfolder in C drive of your computer. First goto myfolder with terminal. after that try below code to build the project...
flutter packages pub run build_runner build --delete-conflicting-outputs
Turn on Your Terminal and Run
flutter doctor
if it is showing
Could not find "flutter"
Then you need to install flutter Correctly You Can check :
https://docs.flutter.dev/get-started/install/windows
Related
while running the code got this error. I tried to reinstall the flutter ,but did not work
It looks more like a Java error,
Just to have a clear conscience, i would suggest you to run the very classic
flutter clean
and then
flutter pub get
if you're using build_runner in your project, run:
flutter pub run build_runner build --delete-conflicting-outputs
Restart your computer, it worked for some people with the same problem (Linked at the end).
If nothing of this works, reinstall your Java.
Check this for more info:
Cannot create service of type TaskExecuter using ProjectExecutionServices
https://github.com/gradle/gradle/issues/12436#issuecomment-678389275
hi friends how to solve this error,i'm just running this command flutter:
Flutter doctor -v,
flutter pub cache clean ,
flutter pub cache repair,
flutter packages pub get,
flutter clean,
dart pub get ,
flutter pub get,
i'm getting an error
Could not find a file named "pubspec.yaml" in "E:\flutter.pub-cache\hosted\pub.dartlang.org\test_api-0.4.8".
Running "flutter pub get" in flutter_tools...
pub get failed (66; Could not find a file named "pubspec.yaml" in
"E:\flutter.pub-cache\hosted\pub.dartlang.org\test_api-0.4.8".)
I had this same issue. Really frustrating.I deleted the pub.dartlang.org folder.
On Mac, in finder command + shift + G | pasted the path from the console | opened in finder and removed the folder.
after deleting the folder
run
Pub get
pub outdated / upgrade
pod repo update
pod update
This fixed my issue and allowed me to build the app.
I try to run test on codemagic with custom pre-test script. And this is my pre-test script:
#!/bin/sh
cd libraries
cd dependencies
flutter pub get
cd ..
cd core
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
cd ..
cd ..
cd features
cd splash
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
cd ..
cd proposal
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
And this I my flutter project structure:
But when the pre-test is running, I get this error:
Running "flutter pub get" in dependencies... 2.5s
Running "flutter pub get" in core... 4.9s
The pubspec.lock file has changed since the .dart_tool/package_config.json file was generated, please run "pub get" again.
pub finished with exit code 65
Running "flutter pub get" in splash... 3.0s
The pubspec.lock file has changed since the .dart_tool/package_config.json file was generated, please run "pub get" again.
pub finished with exit code 65
Running "flutter pub get" in proposal... 3.2s
The pubspec.lock file has changed since the .dart_tool/package_config.json file was generated, please run "pub get" again.
pub finished with exit code 65
Build failed :|
Step 4 script `Pre-test script` exited with status code 65
I think this error is because of flutter pub run build_runner build --delete-conflicting-outputs when I want generated .g.dart file via codemagic.
I try to google but still not found a solution, can someone help me how to solve this error on codemagic?
I fix with add flutter pub run twice.
#!/bin/sh
cd libraries
cd dependencies
flutter pub get
cd ..
cd core
flutter pub get
flutter pub get // add again
flutter pub run build_runner build --delete-conflicting-outputs
cd ..
cd ..
cd features
cd splash
flutter pub get
flutter pub get // add again
flutter pub run build_runner build --delete-conflicting-outputs
cd ..
cd proposal
flutter pub get
flutter pub get // add again
flutter pub run build_runner build --delete-conflicting-outputs
when I am trying to generate the routes for my app using flutter pub run build_runner build
I'm getting an error and the generated class can't be generated
I only see [dynamic] is not a class in the generated class
try to clean and rebuild it ,It worked for me.
flutter packages pub run build_runner clean
then
flutter packages pub run build_runner build
According to the documentation:
Make sure you always Save your files before running the generator, if that doesn't work you can always try to clean and rebuild.
Then:
flutter packages pub run build_runner clean
I want to test my coding exercise for exercism.io. On the Intellij IDEA and Android Studio when I try to type on terminal "$ pub get" and "$ pub run test". I get this error "zsh: command not found: pub or $". I've been stacking here for 2 days. What should I do?
My System: Mac OS Catalina version 10.15.3.
My Android SDK is located: Users/vortovor/Developer/flutter/bin/cache
in cache there is a file named "dart-sdk".
You may want to use the pub shipped with the Flutter version you're using as told on the pub tool section of Dart documentation:
Flutter note: If you’re using the Flutter SDK, don’t use the pub command directly. Instead use the flutter pub command, (...)
flutter pub get
# or
flutter pub test