flutter pub get won't download dependency - flutter

I deleted a package manually from Dart Package directory and deleted pubspec.lock. Now when I do flutter pub get it does not download that package again. I tried flutter clean && flutter pub get but it's not working as well. Please help I can't build my project now.

You can try to close and then open the editor and try:
flutter clean
flutter packages get
flutter packages upgrade

Related

FirebaseAppPlatform.verifyExtends error while running flutter test

When I run my bitbucket pipeline for my project im getting an error during flutter test:
/root/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/firebase_app.dart:18:25: Error: Member not found: 'FirebaseAppPlatform.verifyExtends'.
FirebaseAppPlatform.verifyExtends(_delegate);
^^^^^^^^^^^^^
When I run flutter test in my terminal I don't have these issues.
My pipeline script is:
Build Setup
flutter clean
flutter pub get
flutter pub run build_runner build
bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-dart/main/install.sh)
flutter test
Because there are some breaking change of firebase_core_platform_interface that do not comply with semantic versioning:
https://github.com/firebase/flutterfire/issues/9806
You need to overwrite this library:
Root cause
You are update or installing only a subset of the Firebase plugins (firebase_core, firebase_analytics,...)
Solution
Solution 1: (preferred) Updating to the latest version with flutterfire update check the docs here. But it is not easily because your project will have a lot of packages dependencies to each other like flutter version 2 or 3, so on. Anyway, it is long term solution.
Solution 2: (Fix to run)
You can add to your pubspec.yaml
dependency_overrides:
firebase_core_platform_interface: 4.5.1
Solution 3: (Fix to run)
Update dependencies with this below command line:
flutter pub upgrade --major-versions
Finally, Run the project again by following stuffs:
flutter clean
flutter pub get
cd ios && rm -f Podfile.lock
cd ios && pod install --repo-update
flutter run
That's it!
Run "flutter pub upgrade --major-versions"
run this
flutter pub upgrade --major-versions
than run this
flutter upgrade
I changed my flutter version via flutter channel master. This changed automatically my pubspec.lock.
In my case, restoring previous version of pubspec.lock solved the problem (pug get needed).

Image picker flutter issue

when I try to use image_picker and run the flutter project it gives me error
A problem occurred configuring project ':image_picker_android'.
Could not load compiled classes for build file 'C:\Users\ZerpSteve\Documents\flutter_windows_2.10.2-stable\flutter.pub-cache\hosted\pub.dartlang.org\image_picker_android-0.8.5\android\build.gradle' from cache.
Use this command in your flutter project folder and rerun your project.
flutter clean && flutter pub get

Manually deleted package in External Libraries/Dart Packages not reappearring (Android Studio)

I manually deleted a package in External libraries/dart packages. Now I tried to run packages get again. The package(tesseract_ocr) did not appear in External libraries/dart packages.
I tried removing it in pubspec.yaml and re-adding it but did not appear again. I tried deleting .pub-cache and run packages get again. I tried flutter clean, flutter pub cache repair, flutter pub cache add tessarect_ocr and packages get so many times but none of them made tessarect_ocr package reappear in External libraries/dart packages. Please Help. Thanks in advance!
Try
dart pub cache clean
or
flutter pub cache clean
facing the same issue I did the following things:
1.
flutter pub cache clean
which reinstalled all the packages
2. `
flutter pub get
`
which update the dependencies and it works.

I cannot seem to download/install the carousel_slider package through pubspec.yaml

i have ran flutter pub get multiple times but I'm still not able to download the carousel_slider package
So far I've tried:
Running flutter clean
Running flutter packages get
Running flutter packages get
Restarting my computer
Updated flutter
Tried opening it in VSCode instead
Added another package (but that did install, I could see it in the Dart Packages)
I see that is working well, but you can try deleting the pubspect.lock
In the terminal write this commands:
flutter clean
flutter packages get

Flutter provider installation error while running pub get

I am trying to install provider(flutter package) but getting an error message when trying to run $ pub get :
enter image description here
Provider Package installation error:
update your flutter sdk which is greater then 1.15.17, your current version of flutter SDK. then try to install the flutter package again..
The latest Stable release of flutter is v1.17.1 . So just update your flutter and then add the your desired flutter package..
you need to update your flutter sdk with the command 'flutter upgrade', and only then try to install the provider package again.
try to always keep updated