Error when running flutter pub run build_runner build --delete-conflicting-outputs - flutter

I'm trying to integrate a smart contract into my flutter and I'm referring to this example. I have included all the dependencies and dev_dependencies in the first step and I'm stuck in the second step where this error occurs where the system could not find the path to builders.dart in the web3dart package.

After updating Flutter to version 2.5.2, there were some conflicts even though no code was changed, therefore I use any in pubspec.yaml.
dependencies:
flutter:
sdk: flutter
moor: ^4.5.0
provider: ^5.0.0
path_provider: any
path: ^1.8.0
dev_dependencies:
flutter_test:
sdk: flutter
moor_generator: any
build_runner: any
flutter_launcher_icons: any

For me, I had to downgrade to web3dart: ^2.3.5 from ^2.4.1 (pubspec.yaml)
Ran flutter pub get
But the web3dart-2.4.1 folder remained in .../flutter/.pub-cache/hosted/pub.dartlang.org/
The problem was that build_runner was still looking in the 2.4.1 folder
So I removed everything from the .../flutter/.pub-cache/hosted/pub.dartlang.org/web3dart-2.4.1 folder and moved everything from the .../flutter/.pub-cache/hosted/pub.dartlang.org/web3dart-2.3.5 folder into the .../flutter/.pub-cache/hosted/pub.dartlang.org/web3dart-2.4.1 folder
Closed Android Studio
Reopened it and ran flutter pub run build_runner build
And it worked
CAUTION: DO NOT RUN FLUTTER PUB UPDATE BEFORE RUNNING FLUTTER PUB RUN BUILD_RUNNER BUILD
When I ran flutter pub update, it pulled a completed different web3dart version (2.4.0) into .../pub.dartlang.org/, which has the same bug in it.
Your folder version may be different, but if you can get the web3dart-2.3.5 version and find which folder build_runner is looking in (by running it in Terminal and reading the error message), you can put the good code into there and it should work

Related

Check that your config file `flutter_launcher_icons.yaml` has a `flutter_icons` section

any one have solution to this problem i am running flutter pub run flutter_launcher_icons:main
and it is not working for me
Your pubspec.yaml should be like this:
dev_dependencies:
flutter_launcher_icons: "^0.9.2"
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
Notice where flutter_launcher_icons was used and where
flutter_icons was used.
I just solved the same error you have, and it was something so simple that many of us do not realize it sometimes.
Verify that the terminal is in your project folder.
Try putting flutter_launcher_icons: any in the dev_dependencies: section like in the image.
Verify correct indentation in pubspec.yaml
click to see image
if you facing this problem
✗ ERROR: NoConfigFoundException
Check that your config file flutter_launcher_icons.yaml has a flutter_icons section
try this
uninstall the app from the phone or emulator
Go To Power Shell and run as Administrator
cd ( your project path )
flutter pub get
flutter pub run flutter_launcher_icons:main
flutter run
Just ... Restart android studio
run
flutter clean
flutter pub get
flutter pub run flutter_launcher_icons:main
flutter run

Issue with the installation of flutter_launcher_icons

I added the flutter package "flutter_launcher_icons" but get problems when try to use it.
My "pubspec.yaml":
environment:
sdk: ">=2.13.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_blue: ^0.8.0
csv: ^5.0.0
share: ^2.0.4
path_provider: ^2.0.2
flutter_launcher_icons: ^0.9.0
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/Logo.png"
adaptive_icon_background: "assets/launcher/background.png"
adaptive_icon_foreground: "assets/launcher/foreground.png"
When I run "pub get" I get this (looks OK):
C:\src\flutter\bin\flutter.bat --no-color pub get
Running "flutter pub get" in ble_thms... 790ms
Process finished with exit code 0
But when I try to run the "flutter_launcher_icons" I get this:
C:\src\flutter\packages\flutter_tools>flutter pub run flutter_launcher_icons:main
Could not find package "flutter_launcher_icons". Did you forget to add a dependency?
pub finished with exit code 65
When I try to install "flutter_launcher_icons via terminal its the same:
C:\src\flutter\packages\flutter_tools>flutter pub get flutter_launcher_icons
Running "flutter pub get" in .... 894ms
C:\src\flutter\packages\flutter_tools>flutter pub run flutter_launcher_icons:main
Could not find package "flutter_launcher_icons". Did you forget to add a dependency?
pub finished with exit code 65
How can I solve this problem to use the package "flutter_launcerh_icons"? I also already tried "pub upgrade" and "pub outdated".
add the dependency **flutter_launcher_icons** like so:
flutter pub add flutter_launcher_icons
then:
flutter pub run flutter_launcher_icons:main
Hope this helps anyone with the same issues in the future.
The dependency is dev dependency, so it must go under dev_dependencies list.
dev_dependencies:
flutter_launcher_icons: "^0.9.0"
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
Dev dependency are not necessarily ran on "flutter run", but rather with specific command, like:
flutter pub run flutter_launcher_icons:main -f "pubspec.yaml'
Please refer to installation guide on pub.dev
You should be try to use below dependency:
flutter_launcher_icons: ^0.8.0
Below is your pubspec.yaml file:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: "^0.8.0"
flutter_icons:
image_path: "assets/icon/Logo.png"
android: true
ios: true
Prepare an app icon for the specified path. e.g. icon/icon.png
Execute command on the terminal to Create app icons:
flutter pub get
flutter pub run flutter_launcher_icons:main
OK, it seems that there is a problem with the flutter_tools and the dependence on "image"
C:\src\flutter\packages\flutter_tools>flutter pub add flutter_launcher_icons
The current Dart SDK version is 2.13.4.
Because flutter_launcher_icons <0.4.0 requires SDK version >=1.20.1 <2.0.0 and flutter_launcher_icons >=0.4.0 <0.7.1 depends on image ^2.0.0, flutter_launcher_icons <0.7.1 requires image ^2.0.0.
And because flutter_launcher_icons >=0.7.1 <0.9.0 depends on yaml ^2.1.15 and flutter_launcher_icons >=0.9.0 depends on args 2.0.0, every version of flutter_launcher_icons requires args 2.0.0 or image ^2.0.0 or yaml ^2.1.15.
And because flutter_tools depends on both args 2.1.0 and yaml 3.1.0, every version of flutter_launcher_icons requires image ^2.0.0.
So, because flutter_tools depends on both image ^3.0.2 and flutter_launcher_icons any, version solving failed.
Can I "downgrade" somehow the "flutter_tools" ?
Found the problem:
I somehow changed the path in the Android Studio Console to "C:\src\flutter\packages\flutter_tools".
So I changed it back to the project path "C:\src\Android\AndroidStudioProjects\my_flutter_project".
Now it is working.
Clumsy mistake from my side. :-(
This is how I solved my problem, type this command in the code editor terminal:
flutter pub add package_name
or, if it already exist:
flutter pub upgrade package_name
Hopefully it will solve the problem
I got the same error and i find that i wrote laucher instead of launcher in my command line
I just solved the same error you have, and it was something so simple that many of us do not realize it sometimes.
Verify that the terminal is in your project folder.
Try putting flutter_launcher_icons: any in the dev_dependencies: section like in the image.
Verify correct indentation in pubspec.yaml
click to see image
I had the same problem,
flutter clean
then
flutter pub get
solved it.

"Please upgrade your dependency to build_web_compilers: ">=2.0.0", but it already is

I have an AngularDart-based web project. When I'm try webdev serve, I get this:
[SEVERE] Support for dartdevc in build_web_compilers < 2.0.0 has been removed.
Please upgrade your dependency to:
dev_dependencies:
build_web_compilers: ">=2.0.0"
[SEVERE] Exception: dartdevc is no longer supported by this version
However, I already have the dependency set to "2.0.0 and newer". Here is my pubspec.yaml file:
name: myproject
description: My Description
environment:
sdk: '>=2.3.3 <3.0.0'
dependencies:
angular: ^5.2.0
angular_components: ^0.13.0
dev_dependencies:
angular_test: ^2.2.0
build_runner: ^1.5.0
build_test: ^0.10.3
build_web_compilers: ^2.0.0
pedantic: ^1.0.0
test: ^1.5.1
I tried pub get, pub upgrade, pub activate global webdev, even pub cache repair.
In general, I seem to have problems with dependencies when creating AngularDart projects, even when I use versions from the Dart docs. Is there a magic way to know exactly which version numbers to use?
Try deleting your .dart_tool directory, rerun pub get and try again.
That directory is where dart stores all of the dependencies and artifacts of the build process. Sometimes it can get in an odd state.
Whenever your Dart build is misbehaving in ways that defy explanation, it is good practice to delete the .dart_tool directory first and build clean to see if that fixes it.

Flutter: Running "flutter pub get" nothing happens

I'm trying to get packages, when I run flutter pub get it says a color red text I don't know what this means ! analyzer 0.38.4 and just terminated the process.
C:\Mobi\del_cus_app>flutter pub get
! analyzer 0.38.4
Running "flutter pub get" in del_cus_app... 1.7s
C:\Mobi\del_cus_app>
I also already upgrade the flutter version
Hello BGTabulation BGTabulate, When you trying to get package then sometime our dependency is override on another package so when this kind of issue occurs then may be you have to do like
dependencies:
intl: ^0.15.0
dependency_overrides:
intl: ^0.16.0
Note the space character of the entered values.
dependencies:
flutter_native_splash: ^0.1.9
Delete pubspec.lock file and run flutter pub get
try to using
flutter clean command
then close IDE and restart it again,
it happens sometimes when dart analyzer crashes.

Flutter: packages not added into flutter SDK

We are working on Flutter v1.7.8+hotfix.4, using VS Code added a new package called english_words. the package is updated with all required files in the app but SDK, not updated flutter/packages, here we are unable to see the package folder.
Due to the above issues getting an error from main.dart file
Target of URI doesn't exist 'package:english_words/english_words.dart'.
pubspec.yaml
dependencies:
flutter_test:
sdk: flutter
english_words: ^3.1.5
run flutter packages get got response exit code 0
run flutter pub get or pub get no error.
reload/rebuild the app using flutter run but packages not updated.
pubspec.yaml, pubspec.lock, .packages updated fine.
tried from VS Code Tool click get Packages not solved.
Check if you have this in your pubsec.yaml file
dependencies:
flutter:
sdk: flutter
english_words: ^3.1.5
In you code there is dev_dependencies. Replace this dependency