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).
Related
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
I have a problem that I'm trying to solve since last week, I've been searching about this issue and nothing works. I tried to reinstall the flutter and didn't work aswell. The image below is the first issue I have.
Then I went to "Tools -> Flutter -> Flutter Upgrade" and it shows me this message:
C:\src\flutter\bin\flutter.bat --no-color upgrade
fatal: unterminated line in .git/packed-refs: ...
Building flutter tool...
Running pub upgrade...
ProcessException: Process exited abnormally:
fatal: unterminated line in .git/packed-refs: ...
Command: git fetch --tags
Process finished with exit code 1
And when I tap to "Run 'main.dart'", it shows me this message:
fatal: unterminated line in .git/packed-refs: ...
Building flutter tool...
Running pub upgrade...
Running "flutter pub get" in olx...
The current Flutter SDK version is 0.0.0-unknown.
Because carousel_pro 1.0.0 requires Flutter SDK version >=1.2.0 <2.0.0 and no versions of carousel_pro match >1.0.0 <2.0.0, carousel_pro ^1.0.0 is forbidden.
So, because olx depends on carousel_pro ^1.0.0, version solving failed.
pub get failed (1; So, because olx depends on carousel_pro ^1.0.0, version solving failed.)
What could I do to fix these issues?
(Thanks for listening :)
Here the issue is raised due to Flutter SDK version because it is unknown.
These are some steps that I have followed to solve this problem
Run the following git command into your terminal
=> git clone -b master https://github.com/flutter/flutter.git
(this command will clone a flutter folder which contains latest version of Flutter SDK. get more info about SDK - here)
after cloning, we just need to move cloned folder to our default location of flutter SDK.
In my case path of flutter SDK is as follows(ubuntu) -
=> file:///home/bulbul/snap/flutter/common/flutter
I replaced the last flutter folder with the folder which I have cloned before.
then I ran the "flutter --version" command for getting the version of flutter SDK and it gave me the latest version of flutter SDK and the problem was solved.
It worked for me hopefully It will work for you as well.
Happy learning :)
Use the latest flutter SDK then check if the git is available from the command line using git --version. If it's not available from the command line android studio terminal then add git to system path variable and restart android studio.
When I am running any command that uses dart the response is always as follows;
building flutter tool...
Running Pub upgrade...
The current Dart SDK version is 2.10.0-0.0.dev.flutter-9dca49e71e.
Because flutter_tools depends on collection >=1.15.0-nnbd <1.15.0-nullsafety.2 which requires SDK version >=2.9.0-18.0 <=2.9.10, version solving failed.
I am not able to switch the version nor the channel as those commands run through the same response.
I tried to uninstall flutter and dart, but I have only gotten back to the same issues.
Any help?
Navigate to where to your flutter install directory e.g. C:\Tools\Flutter and do a git pull.
After that you should be able to run any command, such as flutter --help and the Dart SDK will be on the correct version.
This can be verified by running flutter upgrade
I just needed to update my Path ENV Variable
Wrong full snapshot version, expected 'b58ead73b2c5dfec69565df469bba387' found 'be7d304ff826e2dfac63538e227c3cc5'
pub get failed (255; Wrong full snapshot version, expected 'b58ead73b2c5dfec69565df469bba387' found 'be7d304ff826e2dfac63538e227c3cc5')
Update the Flutter SDK with latest version.
By command: flutter upgrade.
I had to remove the flutter SDK folder completely and redownload the latest one.
Then run flutter doctor
https://flutter.dev/docs/get-started/install/macos
Clear flutter cache
rm -rf /flutter/bin/cache
then run flutter clean.
when I try to "serve" my flutter web app
I'm getting this error:
This version of webdev does not support the build_daemon protocol
used by your version of build_runner. A newer version of webdev is
available which supports your version of the build_daemon. Please
update.
how do I update webdev ?
"pub global" seems to offer only "activate"/ "deactivate"
and "pub upgrade" is only looking into the pubspec.yaml file
any idea?
Oh... I just run "pub global deactivate " and then "pub global activate ".
Anyway I opened an issue on github suggesting to add the feature "update".
I hope this easy solution might help you,
feel free to follow up the issue.
Adding build_daemon: ^1.0.0 in dev_dependencies: of .yaml file fix my error
Do not use a global version, but use a per-project version.
To ensure running webdev on your project always works, include the version of webdev it requires in the pubspec.yaml file:
dev_dependencies:
webdev: ^2.7.9
...
And run it using:
$ dart run webdev ...
This ensures the correct version of webdev is installed when dart pub get is run, and that particular version is used for the project.
This avoids having to update the global version when things change. Running dart pub global deactivate webdev and dart pub global activate webdev is unnecessary work.
Globals are bad. Using "dart pub global activate ..." installs only one version of webdev, which may become out-of-date with your project (as you've discovered). Or you might have multiple Dart projects, and they require different versions of webdev. The above approach uses a per-project version of webdev, ensuring it is always the correct version for the project.
I got the same problem now when I followed this tutorial https://medium.com/flutter-community/flutter-create-and-deploy-a-website-from-scratch-4a026ebd6c, but I didn't get pass the error by running flutter pub global activate.
Here is what i configured in my computer
run: pub get
run: webdev serve
dev_dependencies:
build_daemon: ^1.0.0
build_runner: ^1.4.0
build_web_compilers: ^2.0.0
Wish this will fix your issues.
I had to use the following command to update webdev
flutter pub global run webdev deactivate
and then
flutter pub global run webdev activate