Questions tagged [pubspec]

A pubspec file represents the dependency metadata for a Dart package.

For more information, see Dart documentation.

191 questions
12
votes
4 answers

pub get failed : A package may not list itself as a dependency

I'm having this problem in pubspec.yaml : here the pubspec.yaml : dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.2 pluto_grid: ^2.9.3 and here is the Error : [pluto_grid] flutter pub get Running "flutter pub get" in…
Hamou Ouyaba
  • 913
  • 1
  • 4
  • 17
9
votes
2 answers

How to get AppLocalizations import suggestion in Android Studio Quick Fix menu

Problem Statement Currently, bringing up the Android Studio Quick Fix menu (Opt/Alt+Enter keyboard shortcut) on AppLocalizations does not suggest importing the generated file. The AppLocalizations class lives at…
9
votes
1 answer

How to reference packages from repository in Flutter?

I'm trying to modify an existing package on pub.dev. I need to update one of the dependencies in the package. I've seen how to do this from here dependencies: flutter: sdk: flutter graphql_flutter: git: url:…
flutter
  • 6,188
  • 9
  • 45
  • 78
8
votes
7 answers

Flutter flutter_launcher_icons error: pub finished with exit code 255

I want to create my launcher icon for flutter. My config (pubspec.yaml) looks the following. ... # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons:…
Chris
  • 415
  • 5
  • 19
8
votes
1 answer

Share pubspec.yaml package dependency versions along multiple local flutter and dart packages

My flutter project depends on several local flutter and dart packages to keep things separated and clean. My folder structure is like this: main-flutter-project │ lib | test │ pubspec.yaml │ └── local-packages │ └── dart-package-1 │ │ …
tmaihoff
  • 2,867
  • 1
  • 18
  • 40
7
votes
1 answer

Can I use environment variables in pubspec.yaml?

I have private dependency from GitLab in my Flutter mobile app project. It is specified in pubspec.yaml with git repository link and I can successfully run pub get if I use ssh for it (I have generated ssh key and add it to my gitlab account) …
Mol0ko
  • 2,938
  • 1
  • 18
  • 45
6
votes
4 answers

Do I need to update the sdk version in pubspec.yaml file after upgrade flutter?

Do I need to update the sdk version in pubspec.yaml file after upgrade flutter? In this case do I need to change <3.0.0 to <3.1.0? Here is my current version environment: sdk: ">=2.12.0 <3.0.0" Flutter 3.1.0-0.0.pre.1266 • channel master…
Alex Aung
  • 2,637
  • 5
  • 34
  • 63
6
votes
1 answer

FlutterActivity vs FlutterFragmentActivity

I was trying to implement local_auth package into my Flutter app. in the documentation, it was mentioned that it will have to use FlutterFragmentActivity instead of FlutterActivity in my MainActivity class. So I wanted to know the what is main…
6
votes
0 answers

How to build app locker application in flutter

I want to create an app which allows lock on the other apps in device. It like parenting control app. If parents lock some app in the device. It would not be accessed by the child or deleted by him. For any interaction with app it would ask for the…
Hammas Ali
  • 454
  • 1
  • 4
  • 13
5
votes
2 answers

'The asset does not exist or has empty data' but the asset exists and has data

I put in pubspec.yaml and I ran flutter pub get. I can even view the files on the VS code in built file explorer but it still gives the same error. class OnloginScreen extends StatefulWidget { const OnloginScreen({super.key}); @override …
shimomaru
  • 119
  • 1
  • 9
5
votes
1 answer

Pub finished with exit code 69

While installing tflite package in my flutter application .. flutter pub get is not working after few minutes it shows connection timeout server unavailable though other packages are getting installed.
Siddhant8087
  • 51
  • 1
  • 3
5
votes
1 answer

Flutter pubspec.yaml: Publishable packages can't have 'path' dependencies

I made my own Flutter package 1 year ago and want to update it now. I find an error I didn't see before, so would like to get ideas how to solve it. Structure / ∟ pubspec.yaml (pubspec.yaml for my package) ∟ example (example APP that uses my…
dmjy
  • 1,183
  • 3
  • 10
  • 26
5
votes
2 answers

The current version does not meet the minimum version requirements - Huawei Account Kit integration [Flutter]

I am trying to integrate Huawei Account Kit in my flutter project. Since I am not using Huawei phone, I have downloaded the HMS Core in my phone which is version 3.0.0.300. The current version for Huawei Account Kit in my pubspec.yaml is…
Foody
  • 177
  • 1
  • 10
5
votes
0 answers

Flutter ignore certain Dependency in pubspec.yaml for web only

I am trying to migrate my existing Flutter app to web. The problem is that certain packages don't exist for Web, (e.g. ObjectBox). I don't really want to build a whole new project so is there a way to exclude certain dependencies for web? Couldn't…
Chris
  • 1,828
  • 6
  • 40
  • 108
4
votes
0 answers

flutter pub get error "is a relative path, but this isn't a local pubspec."

good day I have the following problem: error on line 40, column 11: Invalid description in the "cdm_flutter_api" pubspec on the "plugincdm" dependency: "./lib/CdmPlugin/" is a relative path, but this isn't a local pubspec. ╷ 40 │ path:…
Hugo Fertl
  • 41
  • 2
1
2 3
12 13