【发布时间】:2021-02-11 09:21:36
【问题描述】:
由于android studio由于未知原因无法启动,
https://www.resume-next.com/android-studio-no-longer-starts-after-updating/
参考上述页面重新安装,并选择“卸载以前的版本”。
之后,我就可以启动新版本的android studio了,
https://flutter.dev/docs/cookbook/testing/unit/mocking
如果您按照上述页面中的说明运行测试,
../flutter/packages/flutter/lib/material.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.8.
// Copyright 2014 The Flutter Authors. All rights reserved.
^
../flutter/packages/flutter_test/lib/src/_goldens_io.dart:5:1: Error: The specified language version is too high. The highest supported language version is 2.8.
// @dart = 2.10
^^^^^^^^^^^^^^^
../flutter/packages/flutter_test/lib/src/_goldens_io.dart:65:48: Error: This requires the 'non-nullable' experiment to be enabled.
Try enabling this experiment by adding it to the command line when compiling and running.
LocalFileComparator(Uri testFile, {path.Style? pathStyle})
^
../flutter/packages/flutter_test/lib/src/_goldens_io.dart:69:42: Error: This requires the 'non-nullable' experiment to be enabled.
Try enabling this experiment by adding it to the command line when compiling and running.
static path.Context _getPath(path.Style? style) {
^
../flutter/packages/flutter_test/lib/src/_goldens_io.dart:73:50: Error: This requires the 'non-nullable' experiment to be enabled.
Try enabling this experiment by adding it to the command line when compiling and running.
static Uri _getBasedir(Uri testFile, path.Style? pathStyle) {
我收到上述错误。
flutter doctor 的结果如下。
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.2, on Mac OS X 10.15.7 19H2, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
[!] Android Studio (version 4.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Android Studio (version 4.0)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Connected device (1 available)
! Doctor found issues in 2 categories.
这需要安装 Flutter 和 Dart 吗?
不过此时其他代码(默认计数器app等)可以正常执行,所以我认为Flutter和Dart已经安装好了。
但是,我认为 Flutter 医生的结果是“Install Flutter and Dart”。
Mac 重启, 运行 Flutter 清洁 运行 Flutter 升级 我在上面试过了,但它没有改变。
【问题讨论】:
标签: android android-studio flutter dart