Created
August 30, 2024 13:22
-
-
Save hareendranmg/d785ad2d6d2afa809b50f5642f0e6d6f to your computer and use it in GitHub Desktop.
gtk3 dev issue flutter yocto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
╭─ ~ ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ✔ at 14:43:05 ─╮ | |
╰─ ssh [email protected] ─╯ | |
The authenticity of host '192.168.10.14 (192.168.10.14)' can't be established. | |
RSA key fingerprint is SHA256:V8Pl7/oTFzWs6wgKXYmRbSd2dhJozrIkUyrFad4k0xk. | |
This key is not known by any other names | |
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes | |
Warning: Permanently added '192.168.10.14' (RSA) to the list of known hosts. | |
root@apalis-imx8-07307228:~# | |
root@apalis-imx8-07307228:~# | |
root@apalis-imx8-07307228:~# | |
root@apalis-imx8-07307228:~# git clone https://github.com/flutter/flutter.git | |
Cloning into 'flutter'... | |
remote: Enumerating objects: 535705, done. | |
remote: Counting objects: 100% (949/949), done. | |
remote: Compressing objects: 100% (591/591), done. | |
remote: Total 535705 (delta 566), reused 581 (delta 327), pack-reused 534756 (from 1) | |
Receiving objects: 100% (535705/535705), 158.04 MiB | 12.52 MiB/s, done. | |
Resolving deltas: 100% (414819/414819), done. | |
Updating files: 100% (8694/8694), done. | |
root@apalis-imx8-07307228:~# bash | |
root@apalis-imx8-07307228:~# echo 'export PATH="~/flutter/bin:$PATH"' >> ~/.profile | |
root@apalis-imx8-07307228:~# source .profile | |
root@apalis-imx8-07307228:~# flutter doctor -v | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
Downloading Linux arm64 Dart SDK from Flutter engine 9c3f66d822e499ee2109dd08b099554bdf2bc93f... | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 207M 100 207M 0 0 14.2M 0 0:00:14 0:00:14 --:--:-- 14.8M | |
Building flutter tool... | |
Resolving dependencies... (6.9s) | |
Downloading packages... (17.6s) | |
Got dependencies. | |
Downloading Material fonts... 2,406ms | |
Downloading Gradle Wrapper... 84ms | |
Downloading package sky_engine... 946ms | |
Downloading package flutter_gpu... 295ms | |
Downloading flutter_patched_sdk tools... 1,117ms | |
Downloading flutter_patched_sdk_product tools... 925ms | |
Downloading linux-arm64 tools... 6.7s | |
Downloading linux-arm64/font-subset tools... 547ms | |
[!] Flutter (Channel master, 3.25.0-1.0.pre.204, on TDX Wayland with XWayland 6.8.0-devel-20240830055841+build.0 (kirkstone) 5.15.148-6.8.0-devel+git.284966e8d6ee, locale en_US) | |
• Flutter version 3.25.0-1.0.pre.204 on channel master at /home/root/flutter | |
! The flutter binary is not on your path. Consider adding /home/root/flutter/bin to your path. | |
! The dart binary is not on your path. Consider adding /home/root/flutter/bin to your path. | |
• Upstream repository https://github.com/flutter/flutter.git | |
• Framework revision 967286b386 (3 hours ago), 2024-08-30 02:13:13 -0400 | |
• Engine revision 9c3f66d822 | |
• Dart version 3.6.0 (build 3.6.0-198.0.dev) | |
• DevTools version 2.39.0 | |
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades. | |
[✗] Android toolchain - develop for Android devices | |
✗ Unable to locate Android SDK. | |
Install Android Studio from: https://developer.android.com/studio/index.html | |
On first launch it will assist you in installing the Android SDK components. | |
(or visit https://flutter.dev/to/linux-android-setup for detailed instructions). | |
If the Android SDK has been installed to a custom location, please use | |
`flutter config --android-sdk` to update to that location. | |
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) | |
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. | |
[✗] Linux toolchain - develop for Linux desktop | |
• clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) | |
• cmake version 3.22.3 | |
• ninja version 1.10.2 | |
• pkg-config version 0.29.2 | |
✗ GTK 3.0 development libraries are required for Linux development. | |
They are likely available from your distribution (e.g.: apt install libgtk-3-dev) | |
[!] Android Studio (not installed) | |
• Android Studio not found; download from https://developer.android.com/studio/index.html | |
(or visit https://flutter.dev/to/linux-android-setup for detailed instructions). | |
[✓] Connected device (1 available) | |
• Linux (desktop) • linux • linux-arm64 • TDX Wayland with XWayland 6.8.0-devel-20240830055841+build.0 (kirkstone) 5.15.148-6.8.0-devel+git.284966e8d6ee | |
[✓] Network resources | |
• All expected network resources are available. | |
! Doctor found issues in 5 categories. | |
root@apalis-imx8-07307228:~# flutter create sample | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
Creating project sample... | |
Resolving dependencies in `sample`... (3.6s) | |
Downloading packages... (3.5s) | |
Got dependencies in `sample`. | |
Wrote 129 files. | |
All done! | |
You can find general documentation for Flutter at: https://docs.flutter.dev/ | |
Detailed API documentation is available at: https://api.flutter.dev/ | |
If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev | |
In order to run your application, type: | |
$ cd sample | |
$ flutter run | |
Your application code is in sample/lib/main.dart. | |
root@apalis-imx8-07307228:~# cd sample/ | |
root@apalis-imx8-07307228:~/sample# flutter run | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
Downloading linux-arm64-debug/linux-arm64-flutter-gtk tools... 5.6s | |
Downloading linux-arm64-profile/linux-arm64-flutter-gtk tools... 3.2s | |
Downloading linux-arm64-release/linux-arm64-flutter-gtk tools... 2,905ms | |
Launching lib/main.dart on Linux in debug mode... | |
CMake Error at /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:603 (message): | |
A required package was not found | |
Call Stack (most recent call first): | |
/usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:825 (_pkg_check_modules_internal) | |
flutter/CMakeLists.txt:25 (pkg_check_modules) | |
Building Linux application... | |
Error: Unable to generate build files | |
root@apalis-imx8-07307228:~/sample# opkg list-installed | grep gtk | |
gtk+3-dev - 3.24.34-r0 | |
gtk+3-locale-en - 3.24.34-r0 | |
gtk4-dev - 4.6.2-r0 | |
gtk4-locale-en - 4.6.2-r0 | |
libgtk-3.0 - 3.24.34-r0 | |
libgtk-4.0 - 4.6.2-r0 | |
root@apalis-imx8-07307228:~/sample# ls /usr/lib/libgtk-3.so | |
/usr/lib/libgtk-3.so | |
root@apalis-imx8-07307228:~/sample# ls /usr/include/gtk-3.0/ | |
gdk gtk unix-print | |
root@apalis-imx8-07307228:~/sample# pkg-config --modversion gtk+-3.0 | |
3.24.34 | |
root@apalis-imx8-07307228:~/sample# ls | |
README.md analysis_options.yaml android build ios lib linux macos pubspec.lock pubspec.yaml sample.iml test web windows | |
root@apalis-imx8-07307228:~/sample# cd linux/ | |
root@apalis-imx8-07307228:~/sample/linux# ls | |
CMakeLists.txt flutter main.cc my_application.cc my_application.h | |
root@apalis-imx8-07307228:~/sample/linux# cat CMakeLists.txt | |
# Project-level configuration. | |
cmake_minimum_required(VERSION 3.10) | |
project(runner LANGUAGES CXX) | |
# The name of the executable created for the application. Change this to change | |
# the on-disk name of your application. | |
set(BINARY_NAME "sample") | |
# The unique GTK application identifier for this application. See: | |
# https://wiki.gnome.org/HowDoI/ChooseApplicationID | |
set(APPLICATION_ID "com.example.sample") | |
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent | |
# versions of CMake. | |
cmake_policy(SET CMP0063 NEW) | |
# Load bundled libraries from the lib/ directory relative to the binary. | |
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") | |
# Root filesystem for cross-building. | |
if(FLUTTER_TARGET_PLATFORM_SYSROOT) | |
set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) | |
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) | |
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | |
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | |
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | |
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | |
endif() | |
# Define build configuration options. | |
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | |
set(CMAKE_BUILD_TYPE "Debug" CACHE | |
STRING "Flutter build mode" FORCE) | |
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS | |
"Debug" "Profile" "Release") | |
endif() | |
# Compilation settings that should be applied to most targets. | |
# | |
# Be cautious about adding new options here, as plugins use this function by | |
# default. In most cases, you should add new options to specific targets instead | |
# of modifying this function. | |
function(APPLY_STANDARD_SETTINGS TARGET) | |
target_compile_features(${TARGET} PUBLIC cxx_std_14) | |
target_compile_options(${TARGET} PRIVATE -Wall -Werror) | |
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>") | |
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>") | |
endfunction() | |
# Flutter library and tool build rules. | |
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") | |
add_subdirectory(${FLUTTER_MANAGED_DIR}) | |
# System-level dependencies. | |
find_package(PkgConfig REQUIRED) | |
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) | |
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") | |
# Define the application target. To change its name, change BINARY_NAME above, | |
# not the value here, or `flutter run` will no longer work. | |
# | |
# Any new source files that you add to the application should be added here. | |
add_executable(${BINARY_NAME} | |
"main.cc" | |
"my_application.cc" | |
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" | |
) | |
# Apply the standard set of build settings. This can be removed for applications | |
# that need different build settings. | |
apply_standard_settings(${BINARY_NAME}) | |
# Add dependency libraries. Add any application-specific dependencies here. | |
target_link_libraries(${BINARY_NAME} PRIVATE flutter) | |
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) | |
# Run the Flutter tool portions of the build. This must not be removed. | |
add_dependencies(${BINARY_NAME} flutter_assemble) | |
# Only the install-generated bundle's copy of the executable will launch | |
# correctly, since the resources must in the right relative locations. To avoid | |
# people trying to run the unbundled copy, put it in a subdirectory instead of | |
# the default top-level location. | |
set_target_properties(${BINARY_NAME} | |
PROPERTIES | |
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" | |
) | |
# Generated plugin build rules, which manage building the plugins and adding | |
# them to the application. | |
include(flutter/generated_plugins.cmake) | |
# === Installation === | |
# By default, "installing" just makes a relocatable bundle in the build | |
# directory. | |
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() | |
# Start with a clean build bundle directory every time. | |
install(CODE " | |
file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") | |
" COMPONENT Runtime) | |
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") | |
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") | |
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" | |
COMPONENT Runtime) | |
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" | |
COMPONENT Runtime) | |
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" | |
COMPONENT Runtime) | |
foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) | |
install(FILES "${bundled_library}" | |
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" | |
COMPONENT Runtime) | |
endforeach(bundled_library) | |
# Copy the native assets provided by the build.dart from all packages. | |
set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") | |
install(DIRECTORY "${NATIVE_ASSETS_DIR}" | |
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" | |
COMPONENT Runtime) | |
# Fully re-copy the assets directory on each build to avoid having stale files | |
# from a previous install. | |
set(FLUTTER_ASSET_DIR_NAME "flutter_assets") | |
install(CODE " | |
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") | |
" COMPONENT Runtime) | |
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" | |
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) | |
# Install the AOT library on non-Debug builds only. | |
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") | |
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" | |
COMPONENT Runtime) | |
endif() | |
root@apalis-imx8-07307228:~/sample/linux# cd flutter/ | |
root@apalis-imx8-07307228:~/sample/linux/flutter# ls | |
CMakeLists.txt ephemeral generated_plugin_registrant.cc generated_plugin_registrant.h generated_plugins.cmake | |
root@apalis-imx8-07307228:~/sample/linux/flutter# curl https://getmic.ro | bash | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 9892 100 9892 0 0 8586 0 0:00:01 0:00:01 --:--:-- 8594 | |
Detected platform: linux-arm64 | |
Latest Version: 2.0.14 | |
Downloading https://github.com/zyedidia/micro/releases/download/v2.0.14/micro-2.0.14-linux-arm64.tgz | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 | |
100 4205k 100 4205k 0 0 1690k 0 0:00:02 0:00:02 --:--:-- 7919k | |
micro-2.0.14/micro | |
/=====================================\\ | |
| update-alternatives is supported | | |
\\=====================================/ | |
getmicro can use update-alternatives to register micro as a system text editor. | |
For example, this will allow `crontab -e` open the cron file with micro. | |
To enable this feature, define the GETMICRO_REGISTER variable or use the URL | |
`https://getmic.ro/r`. | |
Note that you must install micro to a directory accessible to all users when doing | |
this, typically /usr/bin. cd to that directory before running this script. | |
E.g.: | |
$ cd /usr/bin | |
$ curl https://getmic.ro/r | sudo sh | |
or | |
$ su - root -c "cd /usr/bin; wget -O- https://getmic.ro | GETMICRO_REGISTER=y sh" | |
__ __ _ ___ _ _ _ _ _ | |
| \/ (_) ___ _ __ ___ |_ _|_ __ ___| |_ __ | | | ___ __| | | | |
| |\/| | |/ __| '__/ _ \ | || '_ \/ __| __/ _\ | | |/ _ \/ _ | | | |
| | | | | (__| | | (_) | | || | | \__ \ || (_| | | | __/ (_| |_| | |
|_| |_|_|\___|_| \___/ |___|_| |_|___/\__\__,_|_|_|\___|\__,_(_) | |
Micro has been downloaded to the current directory. | |
You can run it with: | |
./micro | |
root@apalis-imx8-07307228:~/sample/linux/flutter# mc micro /usr/bin/ | |
bash: mc: command not found | |
root@apalis-imx8-07307228:~/sample/linux/flutter# mv micro /usr/bin/ | |
root@apalis-imx8-07307228:~/sample/linux/flutter# micro CMakeLists.txt | |
root@apalis-imx8-07307228:~/sample/linux/flutter# cd ../../ | |
root@apalis-imx8-07307228:~/sample# flutter run | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
Launching lib/main.dart on Linux in debug mode... | |
CMake Error at /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:603 (message): | |
A required package was not found | |
Call Stack (most recent call first): | |
/usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:825 (_pkg_check_modules_internal) | |
flutter/CMakeLists.txt:25 (pkg_check_modules) | |
Building Linux application... | |
micro^Cthe Dart compiler exited unexpectedly. | |
Error: Unable to generate build files | |
root@apalis-imx8-07307228:~/sample# micro linux/flutter/CMakeLists.txt | |
root@apalis-imx8-07307228:~/sample# micro linux/flutter/CMakeLists.txt | |
root@apalis-imx8-07307228:~/sample# cat linux/flutter/CMakeLists.txt | |
# This file controls Flutter-level build steps. It should not be edited. | |
cmake_minimum_required(VERSION 3.10) | |
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") | |
# Configuration provided via flutter tool. | |
include(${EPHEMERAL_DIR}/generated_config.cmake) | |
# TODO: Move the rest of this into files in ephemeral. See | |
# https://github.com/flutter/flutter/issues/57146. | |
# Serves the same purpose as list(TRANSFORM ... PREPEND ...), | |
# which isn't available in 3.10. | |
function(list_prepend LIST_NAME PREFIX) | |
set(NEW_LIST "") | |
foreach(element ${${LIST_NAME}}) | |
list(APPEND NEW_LIST "${PREFIX}${element}") | |
endforeach(element) | |
set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) | |
endfunction() | |
# === Flutter Library === | |
# System-level dependencies. | |
find_package(PkgConfig REQUIRED) | |
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) | |
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) | |
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) | |
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") | |
# Published to parent scope for install step. | |
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) | |
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) | |
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) | |
set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) | |
list(APPEND FLUTTER_LIBRARY_HEADERS | |
"fl_basic_message_channel.h" | |
"fl_binary_codec.h" | |
"fl_binary_messenger.h" | |
"fl_dart_project.h" | |
"fl_engine.h" | |
"fl_json_message_codec.h" | |
"fl_json_method_codec.h" | |
"fl_message_codec.h" | |
"fl_method_call.h" | |
"fl_method_channel.h" | |
"fl_method_codec.h" | |
"fl_method_response.h" | |
"fl_plugin_registrar.h" | |
"fl_plugin_registry.h" | |
"fl_standard_message_codec.h" | |
"fl_standard_method_codec.h" | |
"fl_string_codec.h" | |
"fl_value.h" | |
"fl_view.h" | |
"flutter_linux.h" | |
) | |
list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") | |
add_library(flutter INTERFACE) | |
target_include_directories(flutter INTERFACE | |
"${EPHEMERAL_DIR}" | |
) | |
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") | |
target_link_libraries(flutter INTERFACE | |
PkgConfig::GTK | |
PkgConfig::GLIB | |
PkgConfig::GIO | |
) | |
add_dependencies(flutter flutter_assemble) | |
# === Flutter tool backend === | |
# _phony_ is a non-existent file to force this command to run every time, | |
# since currently there's no way to get a full input/output list from the | |
# flutter tool. | |
add_custom_command( | |
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} | |
${CMAKE_CURRENT_BINARY_DIR}/_phony_ | |
COMMAND ${CMAKE_COMMAND} -E env | |
${FLUTTER_TOOL_ENVIRONMENT} | |
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" | |
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} | |
VERBATIM | |
) | |
add_custom_target(flutter_assemble DEPENDS | |
"${FLUTTER_LIBRARY}" | |
${FLUTTER_LIBRARY_HEADERS} | |
) | |
root@apalis-imx8-07307228:~/sample# glxinfo | grep -i opengl | |
bash: glxinfo: command not found | |
root@apalis-imx8-07307228:~/sample# pkg-config --exists | |
Must specify package names on the command line | |
root@apalis-imx8-07307228:~/sample# pkg-config --exists gtk+-3.0 | |
root@apalis-imx8-07307228:~/sample# pkg-config --exists glib-2.0 | |
root@apalis-imx8-07307228:~/sample# cd | |
root@apalis-imx8-07307228:~# flutter doctor | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
Doctor summary (to see all details, run flutter doctor -v): | |
[!] Flutter (Channel master, 3.25.0-1.0.pre.204, on TDX Wayland with XWayland 6.8.0-devel-20240830055841+build.0 (kirkstone) 5.15.148-6.8.0-devel+git.284966e8d6ee, locale en_US) | |
! The flutter binary is not on your path. Consider adding /home/root/flutter/bin to your path. | |
! The dart binary is not on your path. Consider adding /home/root/flutter/bin to your path. | |
[✗] Android toolchain - develop for Android devices | |
✗ Unable to locate Android SDK. | |
Install Android Studio from: https://developer.android.com/studio/index.html | |
On first launch it will assist you in installing the Android SDK components. | |
(or visit https://flutter.dev/to/linux-android-setup for detailed instructions). | |
If the Android SDK has been installed to a custom location, please use | |
`flutter config --android-sdk` to update to that location. | |
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) | |
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. | |
[✗] Linux toolchain - develop for Linux desktop | |
✗ GTK 3.0 development libraries are required for Linux development. | |
They are likely available from your distribution (e.g.: apt install libgtk-3-dev) | |
[!] Android Studio (not installed) | |
[✓] Connected device (1 available) | |
[✓] Network resources | |
! Doctor found issues in 5 categories. | |
root@apalis-imx8-07307228:~# micro .profile | |
root@apalis-imx8-07307228:~# source .profile | |
root@apalis-imx8-07307228:~# flutter doctor -v | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
[✓] Flutter (Channel master, 3.25.0-1.0.pre.204, on TDX Wayland with XWayland 6.8.0-devel-20240830055841+build.0 (kirkstone) 5.15.148-6.8.0-devel+git.284966e8d6ee, locale en_US) | |
• Flutter version 3.25.0-1.0.pre.204 on channel master at /home/root/flutter | |
• Upstream repository https://github.com/flutter/flutter.git | |
• Framework revision 967286b386 (5 hours ago), 2024-08-30 02:13:13 -0400 | |
• Engine revision 9c3f66d822 | |
• Dart version 3.6.0 (build 3.6.0-198.0.dev) | |
• DevTools version 2.39.0 | |
[✗] Android toolchain - develop for Android devices | |
✗ Unable to locate Android SDK. | |
Install Android Studio from: https://developer.android.com/studio/index.html | |
On first launch it will assist you in installing the Android SDK components. | |
(or visit https://flutter.dev/to/linux-android-setup for detailed instructions). | |
If the Android SDK has been installed to a custom location, please use | |
`flutter config --android-sdk` to update to that location. | |
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) | |
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. | |
[✗] Linux toolchain - develop for Linux desktop | |
• clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) | |
• cmake version 3.22.3 | |
• ninja version 1.10.2 | |
• pkg-config version 0.29.2 | |
✗ GTK 3.0 development libraries are required for Linux development. | |
They are likely available from your distribution (e.g.: apt install libgtk-3-dev) | |
[!] Android Studio (not installed) | |
• Android Studio not found; download from https://developer.android.com/studio/index.html | |
(or visit https://flutter.dev/to/linux-android-setup for detailed instructions). | |
[✓] Connected device (1 available) | |
• Linux (desktop) • linux • linux-arm64 • TDX Wayland with XWayland 6.8.0-devel-20240830055841+build.0 (kirkstone) 5.15.148-6.8.0-devel+git.284966e8d6ee | |
[✓] Network resources | |
• All expected network resources are available. | |
! Doctor found issues in 4 categories. | |
root@apalis-imx8-07307228:~# pkg-config --modversion gtk+-3.0 | |
3.24.34 | |
root@apalis-imx8-07307228:~# cd sample | |
root@apalis-imx8-07307228:~/sample# flutter clean | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
Deleting build... 17ms | |
Deleting .dart_tool... 1ms | |
Deleting Generated.xcconfig... 4ms | |
Deleting flutter_export_environment.sh... 1ms | |
Deleting ephemeral... 1ms | |
Deleting ephemeral... 1ms | |
Deleting ephemeral... 1ms | |
root@apalis-imx8-07307228:~/sample# flutter run -d linux | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
Resolving dependencies... (1.1s) | |
Downloading packages... | |
material_color_utilities 0.11.1 (0.12.0 available) | |
Got dependencies! | |
1 package has newer versions incompatible with dependency constraints. | |
Try `flutter pub outdated` for more information. | |
Launching lib/main.dart on Linux in debug mode... | |
CMake Error at /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:603 (message): | |
A required package was not found | |
Call Stack (most recent call first): | |
/usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:825 (_pkg_check_modules_internal) | |
flutter/CMakeLists.txt:25 (pkg_check_modules) | |
Building Linux application... | |
Error: Unable to generate build files | |
root@apalis-imx8-07307228:~/sample# pkg-config --modversion blkid | |
2.37.4 | |
root@apalis-imx8-07307228:~/sample# micro linux/flutter/CMakeLists.txt | |
root@apalis-imx8-07307228:~/sample# flutter clean | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
Deleting build... 13ms | |
Deleting .dart_tool... 1ms | |
Deleting Generated.xcconfig... 3ms | |
Deleting flutter_export_environment.sh... 0ms | |
Deleting ephemeral... 1ms | |
Deleting ephemeral... 1ms | |
Deleting ephemeral... 0ms | |
root@apalis-imx8-07307228:~/sample# flutter run -d linux | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
Resolving dependencies... (1.6s) | |
Downloading packages... | |
material_color_utilities 0.11.1 (0.12.0 available) | |
Got dependencies! | |
1 package has newer versions incompatible with dependency constraints. | |
Try `flutter pub outdated` for more information. | |
Launching lib/main.dart on Linux in debug mode... | |
CMake Error at /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:603 (message): | |
A required package was not found | |
Call Stack (most recent call first): | |
/usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:825 (_pkg_check_modules_internal) | |
flutter/CMakeLists.txt:25 (pkg_check_modules) | |
Building Linux application... | |
^Cthe Dart compiler exited unexpectedly. | |
Error: Unable to generate build files | |
root@apalis-imx8-07307228:~/sample# micro linux/flutter/CMakeLists.txt | |
root@apalis-imx8-07307228:~/sample# pkg-config --modversion gtkmm | |
Package gtkmm was not found in the pkg-config search path. | |
Perhaps you should add the directory containing `gtkmm.pc' | |
to the PKG_CONFIG_PATH environment variable | |
No package 'gtkmm' found | |
root@apalis-imx8-07307228:~/sample# pkg-config --modversion gtk+-3.0 | |
3.24.34 | |
root@apalis-imx8-07307228:~/sample# cat linux/flutter/CMakeLists.txt | |
# This file controls Flutter-level build steps. It should not be edited. | |
cmake_minimum_required(VERSION 3.10) | |
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") | |
# Configuration provided via flutter tool. | |
include(${EPHEMERAL_DIR}/generated_config.cmake) | |
# TODO: Move the rest of this into files in ephemeral. See | |
# https://github.com/flutter/flutter/issues/57146. | |
# Serves the same purpose as list(TRANSFORM ... PREPEND ...), | |
# which isn't available in 3.10. | |
function(list_prepend LIST_NAME PREFIX) | |
set(NEW_LIST "") | |
foreach(element ${${LIST_NAME}}) | |
list(APPEND NEW_LIST "${PREFIX}${element}") | |
endforeach(element) | |
set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) | |
endfunction() | |
# === Flutter Library === | |
# System-level dependencies. | |
find_package(PkgConfig REQUIRED) | |
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) | |
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) | |
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) | |
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") | |
# Published to parent scope for install step. | |
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) | |
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) | |
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) | |
set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) | |
list(APPEND FLUTTER_LIBRARY_HEADERS | |
"fl_basic_message_channel.h" | |
"fl_binary_codec.h" | |
"fl_binary_messenger.h" | |
"fl_dart_project.h" | |
"fl_engine.h" | |
"fl_json_message_codec.h" | |
"fl_json_method_codec.h" | |
"fl_message_codec.h" | |
"fl_method_call.h" | |
"fl_method_channel.h" | |
"fl_method_codec.h" | |
"fl_method_response.h" | |
"fl_plugin_registrar.h" | |
"fl_plugin_registry.h" | |
"fl_standard_message_codec.h" | |
"fl_standard_method_codec.h" | |
"fl_string_codec.h" | |
"fl_value.h" | |
"fl_view.h" | |
"flutter_linux.h" | |
) | |
list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") | |
add_library(flutter INTERFACE) | |
target_include_directories(flutter INTERFACE | |
"${EPHEMERAL_DIR}" | |
) | |
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") | |
target_link_libraries(flutter INTERFACE | |
PkgConfig::GTK | |
PkgConfig::GLIB | |
PkgConfig::GIO | |
) | |
add_dependencies(flutter flutter_assemble) | |
# === Flutter tool backend === | |
# _phony_ is a non-existent file to force this command to run every time, | |
# since currently there's no way to get a full input/output list from the | |
# flutter tool. | |
add_custom_command( | |
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} | |
${CMAKE_CURRENT_BINARY_DIR}/_phony_ | |
COMMAND ${CMAKE_COMMAND} -E env | |
${FLUTTER_TOOL_ENVIRONMENT} | |
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" | |
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} | |
VERBATIM | |
) | |
add_custom_target(flutter_assemble DEPENDS | |
"${FLUTTER_LIBRARY}" | |
${FLUTTER_LIBRARY_HEADERS} | |
) | |
root@apalis-imx8-07307228:~/sample# pkg-config --modversion gtk+-3.0 | |
3.24.34 | |
root@apalis-imx8-07307228:~/sample# root@apalis-imx8-07307228:~/sample# pkg-config --modversion gtk+-3.0 | |
bash: root@apalis-imx8-07307228:~/sample#: No such file or directory | |
root@apalis-imx8-07307228:~/sample# 3.24.34 | |
bash: 3.24.34: command not found | |
root@apalis-imx8-07307228:~/sample# root@apalis-imx8-07307228:~/sample# | |
bash: root@apalis-imx8-07307228:~/sample#: No such file or directory | |
root@apalis-imx8-07307228:~/sample# root@apalis-imx8-07307228:~/sample# pkg-config --modversion gtk+-3.0 | |
bash: root@apalis-imx8-07307228:~/sample#: No such file or directory | |
root@apalis-imx8-07307228:~/sample# 3.24.34 | |
bash: 3.24.34: command not found | |
root@apalis-imx8-07307228:~/sample# root@apalis-imx8-07307228:~/sample# | |
bash: root@apalis-imx8-07307228:~/sample#: No such file or directory | |
root@apalis-imx8-07307228:~/sample# echo $PKG_CONFIG_PATH | |
root@apalis-imx8-07307228:~/sample# export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig | |
root@apalis-imx8-07307228:~/sample# echo $PKG_CONFIG_PATH | |
/usr/lib/pkgconfig:/usr/share/pkgconfig | |
root@apalis-imx8-07307228:~/sample# flutter run -d linux | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
Launching lib/main.dart on Linux in debug mode... | |
CMake Error at /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:603 (message): | |
A required package was not found | |
Call Stack (most recent call first): | |
/usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:825 (_pkg_check_modules_internal) | |
flutter/CMakeLists.txt:25 (pkg_check_modules) | |
Building Linux application... | |
^Cthe Dart compiler exited unexpectedly. | |
Error: Unable to generate build files | |
root@apalis-imx8-07307228:~/sample# flutter pub upgrade | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
Resolving dependencies... (3.6s) | |
Downloading packages... | |
material_color_utilities 0.11.1 (0.12.0 available) | |
No dependencies changed. | |
1 package has newer versions incompatible with dependency constraints. | |
Try `flutter pub outdated` for more information. | |
root@apalis-imx8-07307228:~/sample# pkg-config --cflags --libs gtk+-3.0 | |
Package gl was not found in the pkg-config search path. | |
Perhaps you should add the directory containing `gl.pc' | |
to the PKG_CONFIG_PATH environment variable | |
Package 'gl', required by 'epoxy', not found | |
root@apalis-imx8-07307228:~/sample# | |
root@apalis-imx8-07307228:~/sample# | |
root@apalis-imx8-07307228:~/sample# | |
root@apalis-imx8-07307228:~/sample# | |
root@apalis-imx8-07307228:~/sample# | |
root@apalis-imx8-07307228:~/sample# | |
root@apalis-imx8-07307228:~/sample# pkg-config --cflags --libs gtk+-3.0 | |
Package gl was not found in the pkg-config search path. | |
Perhaps you should add the directory containing `gl.pc' | |
to the PKG_CONFIG_PATH environment variable | |
Package 'gl', required by 'epoxy', not found | |
root@apalis-imx8-07307228:~/sample# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/local/lib | |
root@apalis-imx8-07307228:~/sample# export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig | |
root@apalis-imx8-07307228:~/sample# pkg-config --cflags --libs gtk+-3.0 | |
Package gl was not found in the pkg-config search path. | |
Perhaps you should add the directory containing `gl.pc' | |
to the PKG_CONFIG_PATH environment variable | |
Package 'gl', required by 'epoxy', not found | |
root@apalis-imx8-07307228:~/sample# find / -name gl.pc | |
root@apalis-imx8-07307228:~/sample# find / -name glesv2.pc | |
/usr/lib/pkgconfig/glesv2.pc | |
root@apalis-imx8-07307228:~/sample# find / -name egl.pc | |
/usr/lib/pkgconfig/egl.pc | |
root@apalis-imx8-07307228:~/sample# | |
root@apalis-imx8-07307228:~/sample# ls /usr/lib | grep -E 'libGLES|libEGL' | |
libEGL.so | |
libEGL.so.1 | |
libEGL.so.1.5.0 | |
libGLES_CL.so | |
libGLES_CL.so.1 | |
libGLES_CL.so.1.1.0 | |
libGLES_CM.so | |
libGLES_CM.so.1 | |
libGLES_CM.so.1.1.0 | |
libGLESv1_CL.so | |
libGLESv1_CL.so.1 | |
libGLESv1_CL.so.1.1.0 | |
libGLESv1_CM.so | |
libGLESv1_CM.so.1 | |
libGLESv1_CM.so.1.1.0 | |
libGLESv2.so | |
libGLESv2.so.2 | |
libGLESv2.so.2.0.0 | |
root@apalis-imx8-07307228:~/sample# export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig | |
root@apalis-imx8-07307228:~/sample# ln -s /usr/lib/pkgconfig/glesv2.pc /usr/lib/pkgconfig/gl.pc | |
root@apalis-imx8-07307228:~/sample# pkg-config --cflags --libs gtk+-3.0 | |
-DLINUX -DWL_EGL_PLATFORM -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 | |
root@apalis-imx8-07307228:~/sample# pkg-config --cflags --libs gl | |
-lGLESv2 -lEGL | |
root@apalis-imx8-07307228:~/sample# find / -name epoxy.pc | |
/usr/lib/pkgconfig/epoxy.pc | |
root@apalis-imx8-07307228:~/sample# flutter clean | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
Deleting build... 11ms | |
Deleting .dart_tool... 1ms | |
Deleting Generated.xcconfig... 2ms | |
Deleting flutter_export_environment.sh... 1ms | |
Deleting ephemeral... 1ms | |
Deleting ephemeral... 1ms | |
Deleting ephemeral... 1ms | |
root@apalis-imx8-07307228:~/sample# flutter pub get | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
Resolving dependencies... (1.7s) | |
Downloading packages... | |
material_color_utilities 0.11.1 (0.12.0 available) | |
Got dependencies! | |
1 package has newer versions incompatible with dependency constraints. | |
Try `flutter pub outdated` for more information. | |
root@apalis-imx8-07307228:~/sample# flutter run | |
Woah! You appear to be trying to run flutter as root. | |
We strongly recommend running the flutter tool without superuser privileges. | |
/ | |
📎 | |
Launching lib/main.dart on Linux in debug mode... | |
Building Linux application... | |
✓ Built build/linux/arm64/debug/bundle/sample | |
(sample:2513): Gdk-CRITICAL **: 12:06:08.723: gdk_gl_context_make_current: assertion 'GDK_IS_GL_CONTEXT (context)' failed | |
** (sample:2513): WARNING **: 12:06:08.731: Failed to initialize GLArea: No GL implementation is available | |
^CError waiting for a debug connection: The log reader stopped unexpectedly, or never started. | |
Error launching application on Linux. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment