leonidas79
leonidas79

Reputation: 469

can't run Flutter app for web ( dependency error )

i can't run my flutter web app , i got dependency error here is my flutter and dart version :

Flutter 3.7.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b06b8b2710 (1 year, 5 months ago) • 2023-01-23 16:55:55 -0800
Engine • revision b24591ed32
Tools • Dart 2.19.0 • DevTools 2.20.1

here is my pubspec.yml :

name: myApp
description: My Project

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0+1

environment:
  sdk: ">=2.19.0 <3.0.0"
        dependencies:
      abg_utils: 8.0.8
      html_editor_enhanced: 2.5.1
      timeago: ^3.1.0
      maps_toolkit: ^2.0.0
      google_maps_flutter_web: 0.3.2+1
      google_maps_flutter: 2.1.1
      universal_html: 2.0.8
      soundpool: 2.2.0
      provider: 6.0.2
      image_picker: 0.8.4+7
      syncfusion_flutter_charts: 19.2.62


      flutter:
        sdk: flutter

      flutter_lints: ^1.0.4

      # The following adds the Cupertino Icons font to your application.
      # Use with the CupertinoIcons class for iOS style icons.
      cupertino_icons: ^1.0.2

    dependency_overrides:
      platform: ^3.1.4
      win32: ^2.0.0
      device_info_plus: ^3.2.1
      device_info_plus_windows: ^2.1.1
      ffi: ^1.0.0
      firebase_core: ^2.5.0
      firebase_core_web: ^2.1.1
      firebase_messaging_web: ^3.2.12
      firebase_messaging_platform_interface: ^4.2.11
      firebase_messaging: ^14.2.2
      firebase_storage: ^11.0.11
      firebase_core_platform_interface: ^4.2.1
      #cloud_functions_web: ^4.7.0
      #cloud_functions: ^5.0.0


    dev_dependencies:
      flutter_test:
        sdk: flutter

    # For information on the generic Dart part of this file, see the
    # following page: https://dart.dev/tools/pub/pubspec

    # The following section is specific to Flutter.
    flutter:

      # The following line ensures that the Material Icons font is
      # included with your application, so that you can use the icons in
      # the material Icons class.
      uses-material-design: true

when i run flutter run -d chrome i got this error

Launching lib/main.dart on Chrome in debug mode...

../../../.pub-cache/hosted/pub.dev/platform-3.1.4/lib/platform.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.19. // Copyright 2013 The Flutter Authors. All rights reserved. ^ ../../../.pub-cache/hosted/pub.dev/platform-3.1.4/lib/src/interface/local_platform.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.19. // Copyright 2013 The Flutter Authors. All rights reserved. ^ ../../../.pub-cache/hosted/pub.dev/platform-3.1.4/lib/src/interface/platform.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.19. // Copyright 2013 The Flutter Authors. All rights reserved. ^ ../../../.pub-cache/hosted/pub.dev/platform-3.1.4/lib/src/testing/fake_platform.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.19. // Copyright 2013 The Flutter Authors. All rights reserved. ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_web-2.8.10/lib/cloud_firestore_web.dart:53:29: Error: The method 'FirebaseFirestoreWeb.delegateFor' has fewer named arguments than those of overridden method 'FirebaseFirestorePlatform.delegateFor'. FirebaseFirestorePlatform delegateFor( ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_platform_interface-5.16.2/lib/src/platform_interface/platform_interface_firestore.dart:68:29: Context: This is the overridden method ('delegateFor'). FirebaseFirestorePlatform delegateFor( ^ ../../../.pub-cache/hosted/pub.dev/firebase_auth_web-4.6.1/lib/firebase_auth_web.dart:123:27: Error: The parameter 'currentUser' of the method 'FirebaseAuthWeb.setInitialValues' has type 'Map<String, dynamic>?', which does not match the corresponding type, 'PigeonUserDetails?', in the overridden method, 'FirebaseAuthPlatform.setInitialValues'.

any idea how to fix this

Upvotes: 0

Views: 132

Answers (1)

Nex
Nex

Reputation: 1

Run flutter pub get to download and install the updated dependencies.

Also, If you have flexibility with your project's requirements, consider downgrading Flutter to a version compatible with your current dependencies. Check the documentation for each dependency to find a compatible Flutter version.

Upvotes: -1

Related Questions