如何解决:报错:Error resolving plugin dev.flutter.flutter-plugin-loader ?

新手上路,请多包涵

使用:flutter create 【项目名】,命令创建flutter
flutter版本:3.29.2
创建项目后,直接运行报错:

FAILURE: Build failed with an exception.

* Where:
Settings file 'G:\flutterProject\desktop\desktop\android\settings.gradle.kts' line: 23

* What went wrong:
Error resolving plugin [id: 'dev.flutter.flutter-plugin-loader', version: '1.0.0']
> A problem occurred configuring project ':gradle'.
   > Multiple build operations failed.
         Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\12092c73883b5d413c5343450519df07\metadata.bin
         Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\6e60bae89f675d073b6ad72ed848c935\metadata.bin
         Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\7670d2a327deccefbb4319f656d52ccf\metadata.bin
         Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\8a6df3199fe4ce9eb355a963c05b45df\metadata.bin
         Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\350d477d5814a2c2469bb01406d4e0ef\metadata.bin
         Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\547b069c0e108165162488b4df7d242b\metadata.bin
         Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\52bf080e7b5383cfc016c16fc75f36f8\metadata.bin
         Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\2072417fc4efeafd12cfc28f127372c8\metadata.bin
         Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\3ace6054e73c5717226796a0ad06a80f\metadata.bin
         Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\dc1999a97916923a0f067bb88d9e594c\metadata.bin
         ...and 3 more failures.
      > Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\12092c73883b5d413c5343450519df07\metadata.bin
      > Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\6e60bae89f675d073b6ad72ed848c935\metadata.bin
      > Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\7670d2a327deccefbb4319f656d52ccf\metadata.bin
      > Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\8a6df3199fe4ce9eb355a963c05b45df\metadata.bin
      > Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\350d477d5814a2c2469bb01406d4e0ef\metadata.bin
      > Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\547b069c0e108165162488b4df7d242b\metadata.bin
      > Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\52bf080e7b5383cfc016c16fc75f36f8\metadata.bin
      > Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\2072417fc4efeafd12cfc28f127372c8\metadata.bin
      > Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\3ace6054e73c5717226796a0ad06a80f\metadata.bin
      > Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\dc1999a97916923a0f067bb88d9e594c\metadata.bin
      > Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\13a3c92fd91e8edbfe5e11e0fb090b3d\metadata.bin
      > Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\9142c17ba9ec52151f9198893678785f\metadata.bin
      > Could not read workspace metadata from C:\Users\happy\.gradle\caches\8.10.2\transforms\2388a7c901e10d5384c19d8a1d9a7a9c\metadata.bin

* 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.

setting文件内容为:

百度,谷歌,bing,的通用办法,比如clean,gradle版本更换(也没明白更换成什么),都尝试过了。
另:flutter-desktop,桌面应用,可正常使用

阅读 265
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题