Search code examples
androidiosflutterfirebasedart

packages have newer versions incompatible with dependency constraints


Complete noob in flutter. I am trying to solve issues like 'Target of URI doesn't exist 'package:flutter/material.dart'. I observed I have not addressed some packages. So i tried flutter clean --> flutter pub get. This is where I am getting crazy as it wont allow me to install packages. Exact error -

Resolving dependencies...
  intl 0.18.1 (0.19.0 available)
  material_color_utilities 0.5.0 (0.8.0 available)
Got dependencies!
2 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.

Tried flutter update-packages --force-upgrade, Tried putting

dependency_overrides:
  intl: ^0.18.1 
  material_color_utilities: ^0.5.0 

But no matter what I try, same issue. My pubspec.yml is -->

name: rest_app
description: A new Flutter project.
version: 1.0.0+1
environment:
  sdk: '>=3.2.3 <4.0.0'

dependencies:
  flutter:
    sdk: flutter
  google_fonts: ^6.1.0
  provider: ^6.1.1
  firebase_auth: ^4.15.3
  local_auth: ^2.1.7
  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

  assets:
    - assets/

Please help how to solve this. I am trying out this github repo.


Solution

  • no errors in the package dependencies. By the way, if you're new to Flutter development, I recommend finding an open-source Flutter project updated within the last few months. Avoid working with this project built three years ago, as it requires migration from v1 to v2. You have to upgrade your Gradle version, Kotlin version, and compileSdk version. Additionally, configuring Google Firebase services, though unnecessary for the project's functionality, is required just to view the UI. The project is incomplete, with some folders and classes missing!

    In case you're really wondering what on earth he did, please check it here