skip to Main Content

I’m migrating my app to Android 12 and I’ve some problems with dependencies and versions. The app worked well until now. I get this error when I try to execute it.

../../../AppData/Local/Android/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-13.1.0/lib/src/messaging.dart:128:22: Error: A value of type ‘bool’ can’t be returned from a function with return type ‘Future’.

  • ‘Future’ is from ‘dart:async’.
    return _delegate.isSupported();
    ^
    ../../../AppData/Local/Android/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-13.1.0/lib/src/messaging.dart:238:22: Error: The method ‘setDeliveryMetricsExportToBigQuery’ isn’t defined for the class ‘FirebaseMessagingPlatform’.
  • ‘FirebaseMessagingPlatform’ is from ‘package:firebase_messaging_platform_interface/src/platform_interface/platform_interface_messaging.dart’ (‘../../../AppData/Local/Android/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_platform_interface-3.2.1/lib/src/platform_interface/platform_interface_messaging.dart’).
    Try correcting the name to the name of an existing method, or defining a method named ‘setDeliveryMetricsExportToBigQuery’.
    return _delegate.setDeliveryMetricsExportToBigQuery(enabled);
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../../AppData/Local/Android/flutter/.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);
    ^^^^^^^^^^^^^

FAILURE: Build failed with an exception.

Here is my pubspec.yaml file

name: atgapp
description: A new Flutter project.

publish_to: 'none' 

version: 1.0.0+1

environment:
  sdk: ">=2.16.1 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.2
  firebase_core: ^1.12.0
  cloud_firestore: ^3.1.7
  firebase_storage: ^10.2.6
  file_picker: ^5.2.5
  path_provider: ^2.0.1
  image_picker:
  firebase_messaging: ^13.1.0
  flutter_local_notifications: ^13.0.0
  cloud_functions: ^3.2.8
  firebase_auth: ^3.11.2
  animated_splash_screen: ^1.2.0
  diacritic: ^0.1.3
  restart_app: ^1.1.0
  #firebase_messaging: ^10.0.0
dependency_overrides:
  firebase_messaging_platform_interface: 3.2.1

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.1

flutter:
  uses-material-design: true

2

Answers


  1. Chosen as BEST ANSWER

    SOLVED! I've solved searching all firebase related dependencies (core, messaging, etc.) in pubdev and replacing in my Manifest the version to the last published. Now, the app seems to work as expected.


  2. Delete pubspec.lock and run again.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search