首页 > 解决方案 > 在 Android Studio 上运行 Flutter 代码时出现以下错误。(视窗 10)

问题描述

在 Android Studio 上运行 Flutter 代码时出现以下错误。(Windows 10)。我正在使用android-studio-2020.3.1.22-windows, Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19043.1165], locale en-IN)

Launching lib\main.dart on Android SDK built for x86 in debug mode...

Running Gradle task 'assembleDebug'...

Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01

Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01

Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01

Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01

Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

 - package:open_appstore

For solutions, see https://dart.dev/go/unsound-null-safety

FAILURE: Build failed with an exception.

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

* 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 11s
Exception: Gradle task assembleDebug failed with exit code 1

无法解决问题。但它正在工作,当我运行命令时能够看到输出

flutter run --no-sound-null-safety

从终端。似乎是什么问题?

标签: flutterandroid-studiogradle

解决方案


您使用的包不支持空安全,请使用空安全包。


推荐阅读