增加 Flutter 常见问题汇总。

Signed-off-by: rick.chan <cy@haoan119.com>
This commit is contained in:
rick.chan 2024-09-29 15:53:02 +08:00
parent 90073187b6
commit 5ac4541104
1 changed files with 21 additions and 0 deletions

View File

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