Albert
Albert

Reputation: 25

Flutter dependecies error when executing app

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'.

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

Upvotes: 0

Views: 459

Answers (2)

Albert
Albert

Reputation: 25

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.

Upvotes: 0

Heitor
Heitor

Reputation: 612

Delete pubspec.lock and run again.

Upvotes: 0

Related Questions