NotePublic/Software/Development/Environment/Flutter/Flutter_常见问题汇总.md

22 lines
637 B
Markdown

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