0
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/platform-2.2.1/lib/src/interface/local_platform.dart:45:41: Error: Member not found: 'packageRoot'.
  String get packageRoot => io.Platform.packageRoot;
                                        ^^^^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' 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 28s
Exception: Gradle task assembleDebug failed with exit code 1

当我尝试在 android-studio 的模拟器上运行我的颤振应用程序时收到此错误。我该如何解决这个问题?

4

2 回答 2

1

它有效,但通过使用

依赖项:

platform: ^3.1.0
于 2022-02-20T13:47:07.433 回答
0

Platform.packageRoot 成员变量现在已在平台插件中删除。您需要做的就是覆盖对先前版本的依赖。

dependency_overrides:
  platform: 2.2.0
于 2022-02-20T11:08:14.020 回答