Flutter Module 是使用不兼容的 Kotlin 版本编译的。其元数据的二进制版本是1.8.0,预期版本是1.6.0

Kau*_*ale 4 android-studio build.gradle flutter

在扑动中** Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.**

\n

格式化系统后安装Android Studio - Chipmunk | 2021.2.1 补丁 2\nKotlin 版本 - 212-1.6.10-release-923-AS5457.46

\n

Flutter 版本 3.7.3 和 Dart 版本 2.19.2

\n

试过

\n
    \n
  • 使缓存失效
  • \n
  • 清理gradle文件
  • \n
  • 在 Android Studio 中,您可以转到“构建”->“清理项目”
  • \n
  • 扑干净,扑酒吧得到
  • \n
  • 还从系统格式化了操作系统并重新安装
  • \n
\n
\n[\xe2\x9c\x93] Flutter (Channel stable, 3.7.3, on macOS 12.6.6 21G646 darwin-x64, locale\n    en-GB)\n[\xe2\x9c\x93] Android toolchain - develop for Android devices (Android SDK version 33.0.2)\n[\xe2\x9c\x93] Xcode - develop for iOS and macOS (Xcode 14.2)\n[\xe2\x9c\x93] Chrome - develop for the web\n[\xe2\x9c\x93] Android Studio (version 2021.2)\n[\xe2\x9c\x93] VS Code (version 1.78.2)\n[\xe2\x9c\x93] Connected device (3 available)\n[\xe2\x9c\x93] HTTP Host Availability\n\n
Run Code Online (Sandbox Code Playgroud)\n

详细的逐步解答以解决问题

\n

小智 5

我们遇到了同样的问题,我们的项目停滞了一整周,

美国无线电公司:

该问题是由于我们在 flutter 包版本前面添加的^引起的。因此 pubspec.lock 已使用最新版本的软件包进行了修改。

解决方案:

我们从版本中删除了^并按照以下步骤操作

  1. flutter 酒吧缓存清理
  2. 删除 pubspec.lock
  3. 扑扑酒吧得到

这导致使用 pubspec.yaml 中提到的包的确切版本再次生成 pubspec.lock