运行“flutter Upgrade”后显示此错误
当从 pubspec.yaml 停止共享首选项时,此问题隐藏。
我尝试从 pubspec.yaml 更改 dart-sdk 版本,但没有任何改变。
这是错误:
Running Gradle task 'assembleDebug'...
D:\windows\flutter_project\salfa_game\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:34: error: package io.flutter.plugins.sharedpreferences does not exist
flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());
^
1 个错误
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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 36s
Error: Gradle task assembleDebug failed with exit code 1
I expect this error from dart-sdk last version dev chanall:3.4.0-64.0.dev
this is dart sdk version : 3.4.0-64.0.dev,
经过多次尝试后最好解决这个问题,
从 C:\src 中删除 flutter sdk 并再次下载:https://docs.flutter.dev/get-started/install/windows/mobile?tab=download .... 完成所有工作后。