From 5ac454110465299c28ae9049ad1b3019427a425e Mon Sep 17 00:00:00 2001 From: "rick.chan" Date: Sun, 29 Sep 2024 15:53:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20Flutter=20=E5=B8=B8?= =?UTF-8?q?=E8=A7=81=E9=97=AE=E9=A2=98=E6=B1=87=E6=80=BB=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rick.chan --- .../Flutter/Flutter_常见问题汇总.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Software/Development/Environment/Flutter/Flutter_常见问题汇总.md diff --git a/Software/Development/Environment/Flutter/Flutter_常见问题汇总.md b/Software/Development/Environment/Flutter/Flutter_常见问题汇总.md new file mode 100644 index 0000000..dffded8 --- /dev/null +++ b/Software/Development/Environment/Flutter/Flutter_常见问题汇总.md @@ -0,0 +1,21 @@ +# Flutter 常见问题汇总 + +## 1. Flutter Linux Build Error: Permission Denied for “/usr/local/xxx” + +将 CMakeLists.txt 中的: + +```cmake +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() +``` + +修改为: + +```cmake +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +``` + +This change ensures that the CMAKE_INSTALL_PREFIX is set to a directory where the build process can write files without encountering permission issues.