错误导入flutter_test / test_api包。

huangapple go评论55阅读模式
英文:

error importing flutter_test / test_api packages

问题

I'm stocked in a problem related to test_api package.
当我运行我的Flutter应用程序时,我遇到了以下错误。

/Applications/flutter/packages/flutter_test/lib/src/_goldens_io.dart:12:8: Error: Error when reading '../../../.pub-cache/hosted/pub.dev/test_api-0.6.1/lib/expect.dart': No such file or directory
import 'package:test_api/expect.dart' show fail;
       ^
/Applications/flutter/packages/flutter_test/lib/src/binding.dart:17:8: Error: Error when reading '../../../.pub-cache/hosted/pub.dev/test_api-0.6.1/lib/expect.dart': No such file or directory
import 'package:test_api/expect.dart' show fail;
       ^
/Applications/flutter/packages/flutter_test/lib/src/_matchers_io.dart:10:8: Error: Error when reading '../../../.pub-cache/hosted/pub.dev/test_api-0.6.1/lib/src/expect/async_matcher.dart': No such file or directory
import 'package:test_api/src/expect/async_matcher.dart'; // ignore: implementation_imports
       ^
...
(更多错误消息省略)

以上是您提供的错误信息。如果您需要更多帮助,请提供更多上下文或详细信息。

英文:

I'm stocked in a problem related to test_api package.
When In run my flutter app, I have this errors.

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

/Applications/flutter/packages/flutter_test/lib/src/_goldens_io.dart:12:8: Error: Error when reading &#39;../../../.pub-cache/hosted/pub.dev/test_api-0.6.1/lib/expect.dart&#39;: No such file or directory
import &#39;package:test_api/expect.dart&#39; show fail;
^
/Applications/flutter/packages/flutter_test/lib/src/binding.dart:17:8: Error: Error when reading &#39;../../../.pub-cache/hosted/pub.dev/test_api-0.6.1/lib/expect.dart&#39;: No such file or directory
import &#39;package:test_api/expect.dart&#39; show fail;
^
/Applications/flutter/packages/flutter_test/lib/src/_matchers_io.dart:10:8: Error: Error when reading &#39;../../../.pub-cache/hosted/pub.dev/test_api-0.6.1/lib/src/expect/async_matcher.dart&#39;: No such file or directory
import &#39;package:test_api/src/expect/async_matcher.dart&#39;; // ignore: implementation_imports
^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:13:8: Error: Error when reading &#39;../../../.pub-cache/hosted/pub.dev/test_api-0.6.1/lib/src/expect/async_matcher.dart&#39;: No such file or directory
import &#39;package:test_api/src/expect/async_matcher.dart&#39;; // ignore: implementation_imports
^
/Applications/flutter/packages/flutter_test/lib/src/_matchers_io.dart:44:33: Error: Type &#39;AsyncMatcher&#39; not found.
class MatchesGoldenFile extends AsyncMatcher {
^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/_matchers_io.dart:120:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/_matchers_io.dart:120:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:39:7: Error: Type &#39;Matcher&#39; not found.
const Matcher findsNothing = _FindsWidgetMatcher(null, 0);
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:55:7: Error: Type &#39;Matcher&#39; not found.
const Matcher findsWidgets = _FindsWidgetMatcher(1, null);
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:71:7: Error: Type &#39;Matcher&#39; not found.
const Matcher findsOneWidget = _FindsWidgetMatcher(1, 1);
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:87:1: Error: Type &#39;Matcher&#39; not found.
Matcher findsNWidgets(int n) =&gt; _FindsWidgetMatcher(n, n);
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:103:1: Error: Type &#39;Matcher&#39; not found.
Matcher findsAtLeastNWidgets(int n) =&gt; _FindsWidgetMatcher(n, null);
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:120:7: Error: Type &#39;Matcher&#39; not found.
const Matcher isOffstage = _IsOffstage();
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:128:7: Error: Type &#39;Matcher&#39; not found.
const Matcher isOnstage = _IsOnstage();
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:136:7: Error: Type &#39;Matcher&#39; not found.
const Matcher isInCard = _IsInCard();
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:146:7: Error: Type &#39;Matcher&#39; not found.
const Matcher isNotInCard = _IsNotInCard();
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:152:1: Error: Type &#39;Matcher&#39; not found.
Matcher isSameColorAs(Color color) =&gt; _ColorMatcher(targetColor: color);
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:159:7: Error: Type &#39;Matcher&#39; not found.
const Matcher hasOneLineDescription = _HasOneLineDescription();
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:176:7: Error: Type &#39;Matcher&#39; not found.
const Matcher hasAGoodToStringDeep = _HasGoodToStringDeep();
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:190:7: Error: Type &#39;Matcher&#39; not found.
final Matcher throwsFlutterError = throwsA(isFlutterError);
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:205:7: Error: Type &#39;Matcher&#39; not found.
final Matcher throwsAssertionError = throwsA(isAssertionError);
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:215:7: Error: Type &#39;TypeMatcher&#39; not found.
final TypeMatcher&lt;FlutterError&gt; isFlutterError = isA&lt;FlutterError&gt;();
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:225:7: Error: Type &#39;TypeMatcher&#39; not found.
final TypeMatcher&lt;AssertionError&gt; isAssertionError = isA&lt;AssertionError&gt;();
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:230:1: Error: Type &#39;TypeMatcher&#39; not found.
TypeMatcher&lt;T&gt; isInstanceOf&lt;T&gt;() =&gt; isA&lt;T&gt;();
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:251:1: Error: Type &#39;Matcher&#39; not found.
Matcher moreOrLessEquals(double value, { double epsilon = precisionErrorTolerance }) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:265:1: Error: Type &#39;Matcher&#39; not found.
Matcher rectMoreOrLessEquals(Rect value, { double epsilon = precisionErrorTolerance }) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:277:1: Error: Type &#39;Matcher&#39; not found.
Matcher matrixMoreOrLessEquals(Matrix4 value, { double epsilon = precisionErrorTolerance }) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:291:1: Error: Type &#39;Matcher&#39; not found.
Matcher offsetMoreOrLessEquals(Offset value, { double epsilon = precisionErrorTolerance }) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:311:1: Error: Type &#39;Matcher&#39; not found.
Matcher equalsIgnoringHashCodes(Object value) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:320:1: Error: Type &#39;Matcher&#39; not found.
Matcher isMethodCall(String name, { required dynamic arguments }) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:333:1: Error: Type &#39;Matcher&#39; not found.
Matcher coversSameAreaAs(Path expectedPath, { required Rect areaToCompare, int sampleSize = 20 })
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:455:1: Error: Type &#39;AsyncMatcher&#39; not found.
AsyncMatcher matchesGoldenFile(Object key, {int? version}) {
^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:496:1: Error: Type &#39;AsyncMatcher&#39; not found.
AsyncMatcher matchesReferenceImage(ui.Image image) {
^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:522:1: Error: Type &#39;Matcher&#39; not found.
Matcher matchesSemantics({
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:595:8: Error: Type &#39;Matcher&#39; not found.
List&lt;Matcher&gt;? children,
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:695:1: Error: Type &#39;Matcher&#39; not found.
Matcher containsSemantics({
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:768:8: Error: Type &#39;Matcher&#39; not found.
List&lt;Matcher&gt;? children,
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:867:1: Error: Type &#39;AsyncMatcher&#39; not found.
AsyncMatcher meetsGuideline(AccessibilityGuideline guideline) {
^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:875:1: Error: Type &#39;AsyncMatcher&#39; not found.
AsyncMatcher doesNotMeetGuideline(AccessibilityGuideline guideline) {
^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:879:35: Error: Type &#39;Matcher&#39; not found.
class _FindsWidgetMatcher extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:912:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:912:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:939:3: Error: Type &#39;Description&#39; not found.
Description describeMismatch(
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:941:5: Error: Type &#39;Description&#39; not found.
Description mismatchDescription,
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:988:27: Error: Type &#39;Matcher&#39; not found.
class _IsOffstage extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1002:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;offstage&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1002:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;offstage&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1005:26: Error: Type &#39;Matcher&#39; not found.
class _IsOnstage extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1027:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;onstage&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1027:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;onstage&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1030:25: Error: Type &#39;Matcher&#39; not found.
class _IsInCard extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1037:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;in card&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1037:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;in card&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1040:28: Error: Type &#39;Matcher&#39; not found.
class _IsNotInCard extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1047:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;not in card&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1047:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;not in card&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1050:38: Error: Type &#39;Matcher&#39; not found.
class _HasOneLineDescription extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1063:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;one line description&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1063:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;one line description&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1066:40: Error: Type &#39;Matcher&#39; not found.
class _EqualsIgnoringHashCodes extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1100:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1100:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1108:3: Error: Type &#39;Description&#39; not found.
Description describeMismatch(
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1110:5: Error: Type &#39;Description&#39; not found.
Description mismatchDescription,
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1157:36: Error: Type &#39;Matcher&#39; not found.
class _HasGoodToStringDeep extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1250:3: Error: Type &#39;Description&#39; not found.
Description describeMismatch(
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1252:5: Error: Type &#39;Description&#39; not found.
Description mismatchDescription,
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1263:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1263:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1380:1: Error: Type &#39;Matcher&#39; not found.
Matcher within&lt;T&gt;({
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1398:36: Error: Type &#39;Matcher&#39; not found.
class _IsWithinDistance&lt;T&gt; extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1426:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;$value (&#177;$epsilon)&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1426:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;$value (&#177;$epsilon)&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1429:3: Error: Type &#39;Description&#39; not found.
Description describeMismatch(
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1431:5: Error: Type &#39;Description&#39; not found.
Description mismatchDescription,
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1440:33: Error: Type &#39;Matcher&#39; not found.
class _MoreOrLessEquals extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1459:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;$value (&#177;$epsilon)&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1459:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;$value (&#177;$epsilon)&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1462:3: Error: Type &#39;Description&#39; not found.
Description describeMismatch(dynamic item, Description mismatchDescription, Map&lt;dynamic, dynamic&gt; matchState, bool verbose) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1462:46: Error: Type &#39;Description&#39; not found.
Description describeMismatch(dynamic item, Description mismatchDescription, Map&lt;dynamic, dynamic&gt; matchState, bool verbose) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1468:29: Error: Type &#39;Matcher&#39; not found.
class _IsMethodCall extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1523:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1523:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1533:7: Error: Type &#39;Matcher&#39; not found.
const Matcher clipsWithBoundingRect = _ClipsWithBoundingRect();
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1538:7: Error: Type &#39;Matcher&#39; not found.
const Matcher hasNoImmediateClip = _MatchAnythingExceptClip();
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1543:1: Error: Type &#39;Matcher&#39; not found.
Matcher clipsWithBoundingRRect({ required BorderRadius borderRadius }) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1550:1: Error: Type &#39;Matcher&#39; not found.
Matcher clipsWithShapeBorder({ required ShapeBorder shape }) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1571:1: Error: Type &#39;Matcher&#39; not found.
Matcher rendersOnPhysicalModel({
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1588:1: Error: Type &#39;Matcher&#39; not found.
Matcher rendersOnPhysicalShape({
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1598:52: Error: Type &#39;Matcher&#39; not found.
abstract class _FailWithDescriptionMatcher extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1607:3: Error: Type &#39;Description&#39; not found.
Description describeMismatch(
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1609:5: Error: Type &#39;Description&#39; not found.
Description mismatchDescription,
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1640:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1640:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1748:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1748:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1796:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1796:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1833:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt;
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1833:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt;
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1873:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt;
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1873:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt;
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1901:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt;
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1901:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt;
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1905:33: Error: Type &#39;Matcher&#39; not found.
class _CoversSameAreaAs extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1967:3: Error: Type &#39;Description&#39; not found.
Description describeMismatch(
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1969:5: Error: Type &#39;Description&#39; not found.
Description mismatchDescription,
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1977:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt;
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1977:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt;
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1981:29: Error: Type &#39;Matcher&#39; not found.
class _ColorMatcher extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1997:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;matches color $targetColor&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1997:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) =&gt; description.add(&#39;matches color $targetColor&#39;);
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2014:38: Error: Type &#39;AsyncMatcher&#39; not found.
class _MatchesReferenceImage extends AsyncMatcher {
^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2063:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2063:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2068:37: Error: Type &#39;Matcher&#39; not found.
class _MatchesSemanticsData extends Matcher {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2224:14: Error: Type &#39;Matcher&#39; not found.
final List&lt;Matcher&gt;? children;
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2235:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2235:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2525:3: Error: Type &#39;Description&#39; not found.
Description describeMismatch(
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2527:5: Error: Type &#39;Description&#39; not found.
Description mismatchDescription,
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2540:46: Error: Type &#39;AsyncMatcher&#39; not found.
class _MatchesAccessibilityGuideline extends AsyncMatcher {
^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2546:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2546:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2560:51: Error: Type &#39;AsyncMatcher&#39; not found.
class _DoesNotMatchAccessibilityGuideline extends AsyncMatcher {
^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2566:3: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2566:24: Error: Type &#39;Description&#39; not found.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/_goldens_io.dart:120:7: Error: The method &#39;fail&#39; isn&#39;t defined for the class &#39;LocalFileComparator&#39;.
- &#39;LocalFileComparator&#39; is from &#39;package:flutter_test/src/_goldens_io.dart&#39; (&#39;/Applications/flutter/packages/flutter_test/lib/src/_goldens_io.dart&#39;).
Try correcting the name to the name of an existing method, or defining a method named &#39;fail&#39;.
fail(
^^^^
/Applications/flutter/packages/flutter_test/lib/src/_matchers_io.dart:120:24: Error: &#39;Description&#39; isn&#39;t a type.
Description describe(Description description) {
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/binding.dart:1252:7: Error: The method &#39;fail&#39; isn&#39;t defined for the class &#39;AutomatedTestWidgetsFlutterBinding&#39;.
- &#39;AutomatedTestWidgetsFlutterBinding&#39; is from &#39;package:flutter_test/src/binding.dart&#39; (&#39;/Applications/flutter/packages/flutter_test/lib/src/binding.dart&#39;).
Try correcting the name to the name of an existing method, or defining a method named &#39;fail&#39;.
fail(
^^^^
/Applications/flutter/packages/flutter_test/lib/src/binding.dart:1258:6: Error: A value of type &#39;bool?&#39; can&#39;t be assigned to a variable of type &#39;bool&#39; because &#39;bool?&#39; is nullable and &#39;bool&#39; isn&#39;t.
}());
^
/Applications/flutter/packages/flutter_test/lib/src/binding.dart:1897:7: Error: The method &#39;fail&#39; isn&#39;t defined for the class &#39;LiveTestWidgetsFlutterBinding&#39;.
- &#39;LiveTestWidgetsFlutterBinding&#39; is from &#39;package:flutter_test/src/binding.dart&#39; (&#39;/Applications/flutter/packages/flutter_test/lib/src/binding.dart&#39;).
Try correcting the name to the name of an existing method, or defining a method named &#39;fail&#39;.
fail(
^^^^
/Applications/flutter/packages/flutter_test/lib/src/binding.dart:1903:6: Error: A value of type &#39;bool?&#39; can&#39;t be assigned to a variable of type &#39;bool&#39; because &#39;bool?&#39; is nullable and &#39;bool&#39; isn&#39;t.
}());
^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:39:7: Error: &#39;Matcher&#39; isn&#39;t a type.
const Matcher findsNothing = _FindsWidgetMatcher(null, 0);
^^^^^^^
^^^^
Target kernel_snapshot failed: Exception
FAILURE: Build failed with an exception.
* Where:
Script &#39;/Applications/flutter/packages/flutter_tools/gradle/flutter.gradle&#39; line: 1201
* What went wrong:
Execution failed for task &#39;:app:compileFlutterBuildRecDebug&#39;.
&gt; Process &#39;command &#39;/Applications/flutter/bin/flutter&#39;&#39; finished with non-zero exit value 1

<!-- end snippet -->

so that means it doesn't found flutter_test packages as I understand.

I have tried to delete pubspec.lock, flutter clean and pub get,
I have tried flutter pub cache repair and flutter pub cache clean.
I have tried to delete the folder located in .pub-cache/hosted/pub.dev but nothing works. always the same error

Could you please help me with to fix this problem?

Thanks in advance

答案1

得分: 0

将这部分添加到您的pubspec.yaml文件中:

dependency_overrides:
  test_api: 0.4.18
英文:

add this to your pubspec.yaml

dependency_overrides:
test_api: 0.4.18

huangapple
  • 本文由 发表于 2023年7月10日 15:53:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/76651732.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定