在 Android Studio 和 Flutter 升级版本的背景下,当我构建这个时,我的项目会抛出错误。
错误信息:
SEVERE: error[E0658]: use of unstable library feature 'cstr_count_bytes'
SEVERE : error : could not compile `super_native_extensions` (lib) due to previous error [C:\PROJECT\ANDROIDStudio\xxxxxxxxx\build\windows\x64\plugins\super_native_extensions\super_native_extensions_plugin_cargokit.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: la build personnalis�e de 'C:\PROJECT\ANDROIDStudio\xxxxxxxxx\build\windows\x64\CMakeFiles\f48349bdf7bd8afd1dd98a72eb3ec9de\super_native_extensions.dll.rule;C:\PROJECT\ANDROIDStudio\xxxxxxxxx\build\windows\x64\CMakeFiles\ae7c70d23e99463b83dc4ed6f7e31dbb\super_native_extensions_plugin_cargokit.rule;C:\PROJECT\ANDROIDStudio\xxxxxxxxx\windows\flutter\ephemeral\.plugin_symlinks\super_native_extensions\windows\CMakeLists.txt' s'est arr�t�e. Code�-1. [C:\PROJECT\ANDROIDStudio\xxxxxxxxx\build\windows\x64\plugins\super_native_extensions\super_native_extensions_plugin_cargokit.vcxproj]
Error: Build process failed.
颤振——版本:
Flutter 3.24.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 4cf269e36d (8 days ago) • 2024-09-03 14:30:00 -0700
Engine • revision a6bd3f1de1
Tools • Dart 3.5.2 • DevTools 2.37.2
看来与C++语言编译有关。
我已经这样做了,但没有成功:
flutter pub cache clean
flutter clean
您知道如何解决此问题或有任何解决方法吗?
问题所在的包“super_native_extensions”是我在 flutter 项目中使用的“super_drag_and_drop”包的依赖项。
看来这个包是用rust编译的
我通过像这样更新 rust env 解决了我的问题:
rustup update
当然,一切都很好,我用这些再次清理了我的项目:
flutter clean
flutter pub cache clean
现在,当我重新运行构建项目时,所有项目都运行正确