Issue with the installation of flutter_launcher_icons - flutter

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.

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

widget_test.dart seems to not detect the app.?

so this the widget_test.dart
and these are the problems
check pubspec.yaml file whether you have included flutter and flutter_test appropriately
dependencies:
flutter:
sdk: flutter
dev_dependencies:
flutter_test:
sdk: flutter
and make sure indentation in yaml file is correct.
if problem does not solved. run flutter clean and flutter pub get

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

flutter pub get error when i edit my pubspec.yaml file

I have an error when i try to add a new plugin in my pubspec.yaml
i add the plugin : easy_localization: ^3.0.0
And i have this error message :
Because flutter_launcher_icons >=0.7.0 <0.9.0 depends on args ^1.5.0 and easy_localization >=3.0.0-nullsafety depends on args ^2.0.0, flutter_launcher_icons >=0.7.0 <0.9.0 is incompatible with easy_localization >=3.0.0-nullsafety.
So, because gameapp depends on both easy_localization ^3.0.0 and flutter_launcher_icons ^0.8.0, version solving failed.
pub get failed (1; So, because gameapp depends on both easy_localization ^3.0.0 and flutter_launcher_icons ^0.8.0, version solving failed.)
Could you try adding,
flutter_launcher_icons: ^0.9.0
args: ^2.0.0
easy_localization: ^3.0.0-nullsafety
to your pubspec.yaml and try saving it again to reload the packages?
The problem is: The library version you want to use is newer than Flutter, and there are two solutions
1: Go to the library website and click on the version and install an old library, for example (easy_localization: ^ 2.3.3)
2: Install the latest version of Flutter. Flutter2

"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.