(两百四十三) 解决flutter test_api 依赖找不到问题
1.报错导入flutter的的时候执行flutter create .报如下错误Because splash depends on flutter_test any from sdk which depends on test_api 0.2.11, test_api 0.2.11 is required.So, because splash depends on test_api 0...
1.报错
导入官方flutter demo的时候执行flutter create .报如下错误
Because splash depends on flutter_test any from sdk which depends on test_api 0.2.11, test_api 0.2.11 is required.
So, because splash depends on test_api 0.2.15, version solving failed.
Running "flutter pub get" in splash...
pub get failed (1; So, because splash depends on test_api 0.2.15, version solving failed.)
2.解决
2.1 下载dev版本的flutter
从报错来看是什么api的版本对不上,估计是稳定版的flutter和依赖对不齐,下载个最新的dev版本的flutter
https://flutter.dev/docs/development/tools/sdk/releases
2.2 配置flutter
将项目的dart sdk设置为新下载好的flutter dev路径
2.3 执行命令生成manifest
F:\environment\flutter_demo\flutter-master\examples\splash>D:\fluttter_dev\flutter_windows_1.18.0-8.0.pre-dev\flutter\bin\flutter create .
(由于flutter设置了环境变量,我不想改,就只能完整路径执行命令了)
F:\environment\flutter_demo\flutter-master\examples\splash>D:\fluttter_dev\flutter_windows_1.18.0-8.0.pre-dev\flutter\bin\flutter create .
Recreating project ....
ios\Runner.xcodeproj\project.xcworkspace\xcshareddata\IDEWorkspaceChecks.plist (created)
ios\Runner.xcodeproj\project.xcworkspace\xcshareddata\WorkspaceSettings.xcsettings (created)
ios\Runner.xcworkspace\xcshareddata\IDEWorkspaceChecks.plist (created)
ios\Runner.xcworkspace\xcshareddata\WorkspaceSettings.xcsettings (created)
Running "flutter pub get" in splash... 2.7s
Wrote 7 files.All done!
[√] Flutter: is fully installed. (Channel dev, v1.18.0-8.0.pre, on Microsoft Windows [Version 10.0.18362.778], locale zh-CN)
[√] Android toolchain - develop for Android devices: is fully installed. (Android SDK version 29.0.3)
[√] Android Studio: is fully installed. (version 3.6)
[√] Connected device: is fully installed. (1 available)In order to run your application, type:
$ cd .
$ flutter runYour application code is in .\lib\main.dart.
之后随便点下get dependencies就好了,可以看到箭头变绿了
更多推荐
所有评论(0)