Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 301
Yuki Avatar asked Sep 14 '25 08:09

Yuki


2 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:

enter image description here

like image 91
Cương Nguyễn Avatar answered Sep 15 '25 22:09

Cương Nguyễn


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!

like image 34
nahoang Avatar answered Sep 15 '25 22:09

nahoang