需要 SDK 版本 >=2.12.0-0 <3.0.0, version solving failed. (Flutter and Dart)

问题描述 投票:0回答:1

当我尝试运行 flutter 应用程序时,不断收到此错误:

The current Dart SDK version is 2.10.0.                                 
                                                                        
Because flutter_app depends on path >=1.8.0-nullsafety.3 which requires SDK version >=2.12.0-0 <3.0.0, version solving failed.

以下是我正在运行的 Flutter 和 Dart SDK 版本的一些信息:

Flutter 1.22.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d408d302e2 (1 year, 8 months ago) • 2020-09-29 11:49:17 -0700
Engine • revision 5babba6c4d
Tools • Dart 2.10.0

根据错误消息,我尝试使用 Flutter SDK 2.0.0,因为它是 Dart 2.12.0 附带的。但是,我却收到此错误:

Running "flutter pub get" in flutter_app... 19.7s



Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety




FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:transformClassesAndResourcesWithR8ForDevRelease'.
> Could not resolve all task dependencies for configuration ':app:devReleaseRuntimeClasspath'.
> Could not resolve androidx.core:core-ktx:+.
Required by:
project :app > project :audioplayers
> Failed to list versions for androidx.core:core-ktx.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/androidx/core/core-ktx/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/androidx/core/core-ktx/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/androidx/core/core-ktx/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 57s

简而言之,Flutter 1.22.X 似乎与我的项目兼容,但它附带的 Dart SDK(2.10.0)却不兼容。但是,如果我将 Flutter SDK 升级到包含兼容的 Dart SDK 的 SDK,那么我的 Flutter SDK 将不再兼容!不管怎样,我都会遇到问题。如有任何帮助,我们将不胜感激!

android flutter dart sdk
1个回答
0
投票
You need flutter sdk 1.22.0 to 1.22.6 work for you.

并非每次最新的 sdk 都使用某些项目制作的旧版本。

快乐富尔特......

© www.soinside.com 2019 - 2024. All rights reserved.