首页 > 解决方案 > 很长一段时间后无法运行 Flutter 应用程序

问题描述

我在两个月前开发了一个应用程序,我今天需要添加一个新功能,所以我今天打开了这个项目。但我无法编译该项目,它只会引发错误,我不明白如何解决它。我有 cached_network_image , youtube_player_flutter 包。

我在下面粘贴了我的错误日志

Compiler message:
../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/youtube_player_flutter- 
5.2.0/lib/src/player/raw_youtube_player.dart:55:30: Error: Getter not found: 'suspending'.
  case AppLifecycleState.suspending:
                         ^^^^^^^^^^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.

 FAILURE: Build failed with an exception.

* Where:
Script '/Users/flutter/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 
780

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/flutter/Developer/flutter/bin/flutter'' finished with non-zero 
exit value 1

* 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 23s

FAILURE: Build failed with an exception.

* What went wrong:
Could not get unknown property 'ANDROIDX_WARNING' for project ':youtube_player' of type 
org.gradle.api.Project.

* 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 23s
Finished with error: Gradle task assembleDebug failed with exit code 1

标签: flutterdartversion

解决方案


推荐阅读