How to resolve versioning in flutter

Issue

I am want to add url_launcher package to pubspec.yml file in flutter.

Code for pubspec.yml

name: url_launch_app
description: A new Flutter application.


version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  #url_launcher: '>=0.1.2 <0.2.0'
  url_launcher: '^0.4.1'

I have added package for url_laucher but when clicked packages get I am facing below error.

Error :

Running "flutter packages get" in url_launch_app…

The current Dart SDK version is 2.3.0-dev.0.1.flutter-cf4444b803.

Because url_launch_app depends on url_launcher >=0.1.1 <3.0.0 which requires SDK version <2.0.0, version solving failed.

pub get failed (1)
Process finished with exit code 1

How to solve this versioning error?

Solution

replace your

url_launcher: '^0.4.1'

by

url_launcher: ^5.0.2

Answered By – Sami Kanafani

Answer Checked By – Jay B. (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *