Closed ZimboPro closed 1 year ago
Not quite sure, are you using a manual or Snap installation of Flutter? Also which version of clang++ do you have installed?
Manual installation of Flutter. Clang I have 13.0.0 and 12.0.1
This issue seems to be Flutter-specific. You may have to nuke the linux
directory and recreate it with flutter create .
and put back in the Rust CMake files.
May be related to flutter/flutter#115376
No resulting changes to CMakeLists.txt in the end after adding Rust CMake back, I have tried some of the suggestions like clean etc but none have worked.
Also tried create a new Flutter project and just copying some of the missing config, deps etc over, same issue
Managed to get it working, I had to change this section in linux/CMakeLists.txt
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()
to
set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
As mentioned in the Flutter issue, not sure why CMake is generating it this way but forcing it managed to resolve it.
EDIT: I also had to update the build/CMakeCache.txt to use g++ instead of clang++
This issue has been marked as stale because it has no activity recently. Please remove the 'stale' label, or comment if the issue persists.
This issue has been closed after a period of inactivity. Please reopen this issue if the problem persists, or open a new one if you have a similar problem.
I have managed to run this template on Windows but it fails on Linux. I have managed to track more or less what the issue is but not sure how to resolve it or why it is required in the first place.
A few things to note, using Clang++ caused CMake to fail to generate the related files. Failed with error:
I managed to succeed with g++ and generate all the required files.
However, if I run
flutter run
orflutter run -d linux
then the build fails.So naturally this is a permission issue but I am not sure why it is required to install the binary to
/usr/local/
. I did not find anything in the documentation stating that it is required to run as admin either.Any help is appreciated.
rustc --version: rustc 1.70.0
cmake --version: cmake version 3.19.7
flutter --version: Flutter 3.10.2 • channel stable
OS: Pop!_OS 22.04 LTS
Thanks do the template.