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
5
Answers
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:
Run "flutter pub upgrade –major-versions"
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
Solution 3: (Fix to run)
Update dependencies with this below command line:
Finally, Run the project again by following stuffs:
That’s it!
run this
flutter pub upgrade –major-versions
than run this
flutter upgrade
I changed my flutter version via
flutter channel master
. This changed automatically mypubspec.lock
.In my case, restoring previous version of
pubspec.lock
solved the problem (pug get
needed).