Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Flutter project showing me a warning 'Packages get' has not been run with suggested solutions,

  • Get Dependencies
  • Upgrade Dependencies
  • Ignore
  • As suggested by Darky , in this answer to go ahead with 'Get Dependencies'

    I tried it but it shows me an error:

    pub get failed

    /SoftSources/Flutter/flutter/bin/flutter --no-color packages get
    Running "flutter packages get" in catalog...
    Incompatible version constraints on test:
    - flutter_test 0.0.0 depends on version 0.12.30+3
    - sample_catalog depends on version 0.12.30+4
    pub get failed (1)
    Process finished with exit code 1
    

    An error indicates an issue with the version of the project (or something else), where should change it in my flutter project?

    Edit: pubspec.yaml

    name: sample_catalog
    description: A collection of Flutter sample apps
    dependencies:
      flutter:
        sdk: flutter
      path: 1.5.1
    dev_dependencies:
      flutter_test:
        sdk: flutter
      flutter_driver:
        sdk: flutter
      args: 1.3.0 # TRANSITIVE DEPENDENCY
      async: 2.0.4 # TRANSITIVE DEPENDENCY
      barback: 0.15.2+14 # TRANSITIVE DEPENDENCY
      boolean_selector: 1.0.2 # TRANSITIVE DEPENDENCY
      charcode: 1.1.1 # TRANSITIVE DEPENDENCY
      cli_util: 0.1.2+1 # TRANSITIVE DEPENDENCY
      collection: 1.14.5 # TRANSITIVE DEPENDENCY
      convert: 2.0.1 # TRANSITIVE DEPENDENCY
      crypto: 2.0.2+1 # TRANSITIVE DEPENDENCY
      csslib: 0.14.1 # TRANSITIVE DEPENDENCY
      file: 2.3.6 # TRANSITIVE DEPENDENCY
      glob: 1.1.5 # TRANSITIVE DEPENDENCY
      html: 0.13.2+2 # TRANSITIVE DEPENDENCY
      http: 0.11.3+16 # TRANSITIVE DEPENDENCY
      http_multi_server: 2.0.4 # TRANSITIVE DEPENDENCY
      http_parser: 3.1.1 # TRANSITIVE DEPENDENCY
      intl: 0.15.2 # TRANSITIVE DEPENDENCY
      io: 0.3.2+1 # TRANSITIVE DEPENDENCY
      isolate: 1.1.0 # TRANSITIVE DEPENDENCY
      js: 0.6.1 # TRANSITIVE DEPENDENCY
      json_rpc_2: 2.0.7 # TRANSITIVE DEPENDENCY
      logging: 0.11.3+1 # TRANSITIVE DEPENDENCY
      matcher: 0.12.1+4 # TRANSITIVE DEPENDENCY
      meta: 1.1.2 # TRANSITIVE DEPENDENCY
      mime: 0.9.6 # TRANSITIVE DEPENDENCY
      mockito: 2.2.3 # TRANSITIVE DEPENDENCY
      multi_server_socket: 1.0.1 # TRANSITIVE DEPENDENCY
      node_preamble: 1.4.0 # TRANSITIVE DEPENDENCY
      package_config: 1.0.3 # TRANSITIVE DEPENDENCY
      package_resolver: 1.0.2 # TRANSITIVE DEPENDENCY
      plugin: 0.2.0+2 # TRANSITIVE DEPENDENCY
      pool: 1.3.4 # TRANSITIVE DEPENDENCY
      pub_semver: 1.3.2 # TRANSITIVE DEPENDENCY
      quiver: 0.28.0 # TRANSITIVE DEPENDENCY
      shelf: 0.7.2 # TRANSITIVE DEPENDENCY
      shelf_packages_handler: 1.0.3 # TRANSITIVE DEPENDENCY
      shelf_static: 0.2.7 # TRANSITIVE DEPENDENCY
      shelf_web_socket: 0.2.2 # TRANSITIVE DEPENDENCY
      source_map_stack_trace: 1.1.4 # TRANSITIVE DEPENDENCY
      source_maps: 0.10.4 # TRANSITIVE DEPENDENCY
      source_span: 1.4.0 # TRANSITIVE DEPENDENCY
      stack_trace: 1.9.1 # TRANSITIVE DEPENDENCY
      stream_channel: 1.6.3 # TRANSITIVE DEPENDENCY
      string_scanner: 1.0.2 # TRANSITIVE DEPENDENCY
      term_glyph: 1.0.0 # TRANSITIVE DEPENDENCY
      test: 0.12.30+4 # TRANSITIVE DEPENDENCY
      typed_data: 1.1.5 # TRANSITIVE DEPENDENCY
      utf: 0.9.0+4 # TRANSITIVE DEPENDENCY
      vector_math: 2.0.5 # TRANSITIVE DEPENDENCY
      vm_service_client: 0.2.4+1 # TRANSITIVE DEPENDENCY
      watcher: 0.9.7+7 # TRANSITIVE DEPENDENCY
      web_socket_channel: 1.0.7 # TRANSITIVE DEPENDENCY
      yaml: 2.1.13 # TRANSITIVE DEPENDENCY
    flutter:
      uses-material-design: true
                    sample_catalog seems to have dependency constraint that conflict with constraints in your pubspec.yaml or other dependencies of your project.
    – Günter Zöchbauer
                    Mar 1, 2018 at 18:28
                    can you show us your pubspec.yaml ? It seems like there's a version conflict on some of your packages
    – Rémi Rousselet
                    Mar 1, 2018 at 18:29
    

    People who you are from Windows OS and still cannot solve pub get failed (1; no message) exit code 1 problem, you can try the below steps:

  • Open Start -> Run -> regedit
  • Go to HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun (If it doesn't exist, create a String value)
  • Change the value to @chcp 65001>nul
  • Run flutter upgrade --force
  • Run flutter pub get in your flutter project folder
  • If it's not showing pub get failed anymore, then you can run your app in your app emulator or physical device.

    Note: This may take some time to run your app.

    Last but not least, pub get failed was a horrible error for me!

    Solution collected from here

    1.Updating Flutter will not work

    2.Restarting PC will not work

    3.Creating new project and running pub get will not work.

    Then only solution is to use VPN for the time being. There are some network issue which is causing the issue.

    @KasunHasanga You may be right, but in my case, it helped solve a similar problem. Other than removing the intl package I didn't do anything. – Boris Feb 20 at 16:18

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.