본문 바로가기

Leave a note/FLUTTER

[DART/FLUTTER] Because {Project} depends on http >=1.1.1 which requires SDK version >=3.2.0 <4.0.0, version solving failed.

반응형
SMALL

 

아래의 에러는 http library 설치시 발생하는 에러이고, 간략하게 설명하자면 

http 1.1.1 라이브러리 버전 이상은 SDK 버전이 3.2.0 이상, 4.0.0 이하이여야 한다 

에러의 내용이다. 

[{Project}] flutter pub get --no-example
Resolving dependencies...
Error on line 32, column 5 of pubspec.yaml: A dependency may only have one source.
   ╷
32 │ ┌     sdk: flutter
33 │ │     dependencies:
34 │ │   http: ^1.2.0
   │ └──^
   ╵
exit code 65

--

[{Project}] flutter pub get --no-example
Resolving dependencies...
The current Dart SDK version is 3.1.5.

Because {Project} depends on http >=1.1.1 which requires SDK version >=3.2.0 <4.0.0, version solving failed.


You can try the following suggestion to make the pubspec resolve:
* Consider downgrading your constraint on http: flutter pub add http:^1.1.0
exit code 1

--

[{Project}] flutter pub get --no-example
Resolving dependencies...
The current Dart SDK version is 3.1.5.

Because {Project} depends on http >=1.1.1 which requires SDK version >=3.2.0 <4.0.0, version solving failed.


You can try the following suggestion to make the pubspec resolve:
* Consider downgrading your constraint on http: flutter pub add http:^1.1.0

 

당연히 dart sdk 의 버전을 올려주면 문제 해결이 되기때문에 간단한 명령어로 dart sdk 버전을 업그레이드 해준다

flutter upgrade 를 입력해주면 아래와 같이, 업그레이드 작업이 수행된다.

>flutter upgrade

Upgrading Flutter to 3.16.8 from 3.13.9 in C:\tools\flutter...
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 6e2ea58a5ccbefcfadc2d4b7b8045fc6c20ab812...
Expanding downloaded archive with PowerShell...
Building flutter tool...
Running pub upgrade...
Resolving dependencies...
Got dependencies.

Upgrading engine...
Downloading android-arm-profile/windows-x64 tools...             1,039ms
Downloading android-arm-release/windows-x64 tools...               482ms
Downloading android-arm64-profile/windows-x64 tools...           1,009ms
Downloading android-arm64-release/windows-x64 tools...             265ms
Downloading android-x64-profile/windows-x64 tools...               328ms
Downloading android-x64-release/windows-x64 tools...               220ms
Downloading android-x86 tools...                                 1,691ms
Downloading android-x64 tools...                                 1,945ms
Downloading android-arm tools...                                 1,057ms
Downloading android-arm-profile tools...                           500ms
Downloading android-arm-release tools...                           407ms
Downloading android-arm64 tools...                                  4.7s
Downloading android-arm64-profile tools...                         584ms
Downloading android-arm64-release tools...                         447ms
Downloading android-x64-profile tools...                           604ms
Downloading android-x64-release tools...                           444ms
Downloading android-x86-jit-release tools...                       725ms
Downloading Web SDK...                                              3.5s
Downloading windows-x64-debug/windows-x64-flutter tools...          5.0s
Downloading windows-x64/flutter-cpp-client-wrapper tools...        158ms
Downloading windows-x64-profile/windows-x64-flutter tools...         4.9s
Downloading windows-x64-release/windows-x64-flutter tools...         3.4s

Flutter 3.16.8 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 67457e669f (8 days ago) • 2024-01-16 16:22:29 -0800
Engine • revision 6e2ea58a5c
Tools • Dart 3.2.5 • DevTools 2.28.5
반응형
LIST