本文最后更新于 2026年5月11日。
直接flutter run会报cmake位置不匹配
CMake Error: The current CMakeCache.txt directory E:/mydoc/mygit/myWPapp/my_wordpress/flutter_application_1/build/windows/x64/CMakeCache.txt is different than the directory e:/mydoc/sync_pc_home_work/myWPapp/my_wordpress/flutter_application_1/build/windows/x64 where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
CMake Error: The source "E:/mydoc/mygit/myWPapp/my_wordpress/flutter_application_1/windows/CMakeLists.txt" does not match the source "E:/mydoc/sync_pc_home_work/myWPapp/my_wordpress/flutter_application_1/windows/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.
Building Windows application... 299ms
Error: Unable to generate build files