When I want add video_trimmer package, show this issue
Add this in pubspec.yaml
dependencies:
video_player: ^0.10.9+1
video_trimmer: ^0.2.4
Related
Can someone help me? Why can't I add this package to my pubspec.yaml?
I assume your project name is also integration_test
, change the name of your project as when running the pub get command, flutter reads the project name instead of the library name.
Add the dependencies to the dev_dependencies section of the app’s pubspec.yaml file, specifying the Flutter SDK as the location of the package.
dev_dependencies:
integration_test:
sdk: flutter
flutter_test:
sdk: flutter
More documentation on here with example.
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
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.
I had tried everything like adding dependencies but VS Code don't show that package is downloaded.
I'm unable to use import 'package:flutter_svg/flutter_svg.dart';
You can change indent of flutter_svg in pubspec.yaml
from
flutter:
sdk: flutter
flutter_svg: ^0.19.0
to
flutter:
sdk: flutter
flutter_svg: ^0.19.0
Maybe if you run flutter pub get in the terminal, then flutter clean then restart your vs code it should work
I have a flutter package that uses effective_dart which is working as expected.
(I've explicitly tested this by adding/removing the include and ensure that warnings come and go as expected.)
I have the effective_dart dependency in my pubspec.yaml as follows:
name: sounds
version: 0.9.1
repository: https://github.com/bsutton/sounds
homepage: https://github.com/bsutton/sounds
documentation: https://github.com/bsutton/sounds/wiki
description: Sounds provide a complete api and Widgets for audio playback and recording. Both iOS and Android are supported.
environment:
sdk: '>=2.1.0 <3.0.0'
flutter: '>=1.17.0 <2.0.0'
dependencies:
device_info: '>=0.4.2+4 <2.0.0'
flutter_spinkit: ^4.0.0
meta: ^1.1.8
path: ^1.6.4
path_provider: ^1.6.7
provider: ^4.1.0
sounds_common: ^1.0.1
uuid: ^2.0.4
flutter:
sdk: flutter
dev_dependencies:
pedantic: ^1.9.0
effective_dart: ^1.2.1
dshell: ^1.0.0
e2e: ^0.5.0
lint: ^1.1.1
pub_semver: ^1.4.4
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
flutter:
plugin:
platforms:
android:
package: com.bsutton.sounds
pluginClass: Sounds
ios:
pluginClass: Sounds
The analysis_options.yaml contains:
include: package:effective_dart/analysis_options.yaml
analyzer:
errors:
todo: ignore
strong-mode:
implicit-casts: false
implicit-dynamic: false
The problem is that I keep getting a warning about the include not being found.
If I make a trivial edit (add a commented out blank line) to the analysis_options.yaml file the error goes away for a while but invariably returns (generally after a restart of the ide).
I'm using vs code but believe I've seen it in android studio (although I can't reproduce it now).
The error:
The include file package:effective_dart/analysis_options.yaml in /home/bsutton/git/sounds/analysis_options.yaml cannot be found.
The problem is having no material impact on my project but its just really annoying to have a warning always showing up.
Using the command given below is worked for me. Let you try it in the terminal.
flutter pub add --dev flutter_lints
(restart VSCode if the warning is still shown)
This seems to be a problem with sub projects (your example folder). See https://github.com/dart-lang/sdk/issues/42910
You can try to exclude the example in your root analysis_options.yaml:
analyzer:
exclude:
# workaround for https://github.com/dart-lang/sdk/issues/42910
- 'example/**'
And then add a separate analysis_options.yaml to the example.
If someone is still looking for the answer for the same error, this worked for me.
I have added flutter_lints: ^1.0.4 in dependencies in pubspec.yml file.
And the error gone.
you can try this command
flutter pub add --dev flutter_lints
if didn't work use this command
flutter pub upgrade flutter_lints
It show's up cuz the project import the flutter lints (as it says to encourage good coding practices). Usually, there's a hashtag in front of it that makes it functionless. When there was no hashtag, it was activated and found for the flutter lints package.
Solution:
Add hashtag # in front of it.
Add flutter_lints: ^1.0.4 package in pubspec.yaml file.