我最近在使用 AR 应用程序时遇到了这个错误。 我最近所做的更改是: 添加:firebase_core 包 添加:model_viewer_plus:^1.7.0
我收到以下错误:
Launching lib\main.dart on sdk gphone x86 in debug mode...
Building with Flutter multidex support enabled.
../../../../../Pub/Cache/hosted/pub.dev/leak_tracker_testing-2.0.3/lib/src/leak_testing.dart:146:9: Error: No named parameter with the name 'notGCed'.
notGCed: ignoredLeaks.notGCed.merge(
^^^^^^^
../../../../../Pub/Cache/hosted/pub.dev/leak_tracker-10.0.4/lib/src/leak_tracking/primitives/model.dart:130:9: Context: Found this candidate, but the arguments don't match.
const IgnoredLeaks({
^^^^^^^^^^^^
../../../../../Pub/Cache/hosted/pub.dev/leak_tracker_testing-2.0.3/lib/src/leak_testing.dart:193:9: Error: No named parameter with the name 'notGCed'.
notGCed: newNotGCed,
^^^^^^^
../../../../../Pub/Cache/hosted/pub.dev/leak_tracker-10.0.4/lib/src/leak_tracking/primitives/model.dart:130:9: Context: Found this candidate, but the arguments don't match.
const IgnoredLeaks({
^^^^^^^^^^^^
../../../../../Pub/Cache/hosted/pub.dev/leak_tracker_testing-2.0.3/lib/src/leak_testing.dart:180:35: Error: The getter 'notGCed' isn't defined for the class 'IgnoredLeaks'.
- 'IgnoredLeaks' is from 'package:leak_tracker/src/leak_tracking/primitives/model.dart' ('../../../../../Pub/Cache/hosted/pub.dev/leak_tracker-10.0.4/lib/src/leak_tracking/primitives/model.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'notGCed'.
var newNotGCed = ignoredLeaks.notGCed.track([...notGCed, ...classes]);
^^^^^^^
Target kernel_snapshot failed: Exception
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '..\..\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 1m 1s
Error: Gradle task assembleDebug failed with exit code 1
Exited (1).
我尝试了
flutter clear
,flutter pub get
,还手动清除了缓存文件。但没有任何结果。
请帮帮我!
此问题已被打包,因为两个包之间存在冲突。
我整理的步骤:
首先从Windows中删除flutter sdk(https://stackoverflow.com/a/72247943/16328198)
删除了android studio中的flutter扩展,并从环境变量中删除了flutter sdk路径。最好重新启动系统。
删除了
/C:/../../AppData/Local/Pub/Cache
的酒吧缓存
重新安装sdk官方指南
运行
flutter --version
。如果是,那么flutter就安装成功了。
希望这也能帮助别人。