Flutter: Running "flutter pub get" nothing happens - flutter

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.

Related

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

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

I am setting Flutter launcher icon using flutter_launcher_icons: ^0.9.2 but when I run command it shows error NoConfigFoundException

PS F:\Hitesh\Orhan\Flutter\Arfic\arificapp> flutter pub get
Running "flutter pub get" in arificapp... 4.7s
PS F:\Hitesh\Orhan\Flutter\Arfic\arificapp> flutter pub run flutter_launcher_icons:main
════════════════════════════════════════════
FLUTTER LAUNCHER ICONS (v0.9.1)
════════════════════════════════════════════
✗ ERROR: NoConfigFoundException
Check that your config file `flutter_launcher_icons.yaml` has a `flutter_icons` section
you need to add your own configuration before do that, look this example:
Go example

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.

modal_progress_hud flutter package cannot be installed

i am trying to install this package "modal_progress_hud".
modal_progress_hud: ^0.1.3
flutter pub get runs successfully but when i try to import the package, it doesn't work as it is shown in the picture.
Running "flutter pub get" in my_project... 0.6s
Process finished with exit code 0
i tried the same process with other packages and it works fine. is it because of the package or what might be the problem? i also ran flutter clean, pub cache repair, flutter pub upgrade, restart Android studio as well as my mac but nothing worked.