Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Could not load flutter engine from any location #371

Open
rsov opened this issue Nov 29, 2023 · 4 comments
Open

Error: Could not load flutter engine from any location #371

rsov opened this issue Nov 29, 2023 · 4 comments

Comments

@rsov
Copy link

rsov commented Nov 29, 2023

Building

Steps on linux (WSL) system:

git clone https://github.com/flutter/gallery.git flutter_gallery
cd flutter_gallery
git checkout d77920b4ced4a105ad35659fbe3958800d418fb9
flutter pub get
flutterpi_tool build --release --cpu=pi4
scp -r ./build/flutter_assets pi@raspberrypi:/home/pi/flutter_gallery

Get warning:

2023/11/29 14:04:38.899981 system_key.go:129: cannot determine nfs usage in generateSystemKey: cannot parse mountinfo: incorrect number of tail fields, expected 3 but found 4
2023/11/29 14:04:38.902915 cmd_run.go:1046: WARNING: cannot create user data directory: cannot determine SELinux status: failed to obtain SELinux mount path: incorrect number of tail fields, expected 3 but found 4

Running

Steps on pi:

flutter-pi --release ~/flutter_gallery

Get error:

flutter-pi.c: Error: Could not load engine from any location. Make sure you have installed the engine binaries.

The libflutter_engine.so is included inside the flutter_gallery directory

@ardera
Copy link
Owner

ardera commented Dec 14, 2023

If the engine can't be loaded, could also be it's for the wrong architecture, or otherwise not executable (somehow).

Configuring and building flutter-pi with -DCMAKE_BUILD_TYPE=Debug should give more information. What does file ~/flutter_gallery say for you?

@rsov
Copy link
Author

rsov commented Dec 19, 2023

cmake output

pi@raspberrypi:~/flutter-pi/build $ cmake .. -DCMAKE_BUILD_TYPE=Debug
-- The C compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Generator .............. Unix Makefiles
-- Build Type ............. Debug
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
-- Checking for module 'libdrm'
--   Found libdrm, version 2.4.114
-- Checking for module 'gbm'
--   Found gbm, version 23.2.1-1~bpo12+rpt2
-- Checking for module 'libsystemd'
--   Found libsystemd, version 252
-- Checking for module 'libinput'
--   Found libinput, version 1.22.1
-- Checking for module 'xkbcommon'
--   Found xkbcommon, version 1.5.0
-- Checking for module 'libudev'
--   Found libudev, version 252
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Checking for module 'egl'
--   Found egl, version 1.5
-- Checking for module 'glesv2'
--   Found glesv2, version 3.2
-- EGL/GLES support ....... ON
-- Lint EGL headers ....... OFF
-- Checking for module 'vulkan'
--   Package 'vulkan', required by 'virtual:world', not found
-- Vulkan support ......... OFF
-- Filesystem Layout ...... default
-- Checking for module 'libseat'
--   Package 'libseat', required by 'virtual:world', not found
libseat was not found. flutter-pi will be built without session switching support.
-- Session switching ...... OFF
-- Checking for module 'gstreamer-1.0'
--   Found gstreamer-1.0, version 1.22.0
-- Checking for module 'gstreamer-plugins-base-1.0'
--   Found gstreamer-plugins-base-1.0, version 1.22.0
-- Checking for module 'gstreamer-app-1.0'
--   Found gstreamer-app-1.0, version 1.22.0
-- Checking for module 'gstreamer-allocators-1.0'
--   Found gstreamer-allocators-1.0, version 1.22.0
-- Checking for module 'gstreamer-video-1.0'
--   Found gstreamer-video-1.0, version 1.22.0
-- Checking for module 'gstreamer-audio-1.0'
--   Found gstreamer-audio-1.0, version 1.22.0
-- Performing Test COMPILER_SUPPORTS_MACRO_PREFIX_MAP
-- Performing Test COMPILER_SUPPORTS_MACRO_PREFIX_MAP - Success
-- IPO/LTO ................ OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/flutter-pi/build

make output

pi@raspberrypi:~/flutter-pi/build $ make -j`nproc`
[  8%] Building C object CMakeFiles/flutterpi_module.dir/src/pluginregistry.c.o
[  8%] Building C object CMakeFiles/flutterpi_module.dir/src/flutter-pi.c.o
[  8%] Building C object CMakeFiles/flutterpi_module.dir/src/platformchannel.c.o
[ 11%] Building C object CMakeFiles/flutterpi_module.dir/src/texture_registry.c.o
[ 14%] Building C object CMakeFiles/flutterpi_module.dir/src/modesetting.c.o
[ 17%] Building C object CMakeFiles/flutterpi_module.dir/src/util/collection.c.o
[ 20%] Building C object CMakeFiles/flutterpi_module.dir/src/util/bitscan.c.o
[ 22%] Building C object CMakeFiles/flutterpi_module.dir/src/util/vector.c.o
[ 25%] Building C object CMakeFiles/flutterpi_module.dir/src/cursor.c.o
[ 28%] Building C object CMakeFiles/flutterpi_module.dir/src/keyboard.c.o
[ 31%] Building C object CMakeFiles/flutterpi_module.dir/src/user_input.c.o
[ 34%] Building C object CMakeFiles/flutterpi_module.dir/src/locales.c.o
[ 37%] Building C object CMakeFiles/flutterpi_module.dir/src/notifier_listener.c.o
[ 40%] Building C object CMakeFiles/flutterpi_module.dir/src/pixel_format.c.o
[ 42%] Building C object CMakeFiles/flutterpi_module.dir/src/filesystem_layout.c.o
[ 45%] Building C object CMakeFiles/flutterpi_module.dir/src/compositor_ng.c.o
[ 48%] Building C object CMakeFiles/flutterpi_module.dir/src/surface.c.o
[ 51%] Building C object CMakeFiles/flutterpi_module.dir/src/render_surface.c.o
[ 54%] Building C object CMakeFiles/flutterpi_module.dir/src/tracer.c.o
[ 57%] Building C object CMakeFiles/flutterpi_module.dir/src/dmabuf_surface.c.o
[ 60%] Building C object CMakeFiles/flutterpi_module.dir/src/frame_scheduler.c.o
[ 62%] Building C object CMakeFiles/flutterpi_module.dir/src/window.c.o
[ 65%] Building C object CMakeFiles/flutterpi_module.dir/src/dummy_render_surface.c.o
[ 68%] Building C object CMakeFiles/flutterpi_module.dir/src/plugins/services.c.o
[ 71%] Building C object CMakeFiles/flutterpi_module.dir/src/egl_gbm_render_surface.c.o
[ 74%] Building C object CMakeFiles/flutterpi_module.dir/src/gl_renderer.c.o
[ 77%] Building C object CMakeFiles/flutterpi_module.dir/src/plugins/text_input.c.o
[ 80%] Building C object CMakeFiles/flutterpi_module.dir/src/plugins/raw_keyboard.c.o
[ 82%] Building C object CMakeFiles/flutterpi_module.dir/src/plugins/gstreamer_video_player/plugin.c.o
[ 85%] Building C object CMakeFiles/flutterpi_module.dir/src/plugins/gstreamer_video_player/player.c.o
[ 88%] Building C object CMakeFiles/flutterpi_module.dir/src/plugins/gstreamer_video_player/frame.c.o
[ 91%] Building C object CMakeFiles/flutterpi_module.dir/src/plugins/audioplayers/plugin.c.o
[ 94%] Building C object CMakeFiles/flutterpi_module.dir/src/plugins/audioplayers/player.c.o
[ 94%] Built target flutterpi_module
[ 97%] Building C object CMakeFiles/flutter-pi.dir/src/main.c.o
[100%] Linking C executable flutter-pi
[100%] Built target flutter-pi

make install output

pi@raspberrypi:~/flutter-pi/build $ sudo make install
[ 94%] Built target flutterpi_module
[100%] Built target flutter-pi
Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/bin/flutter-pi

File listing, not executable. chmod +x libflutter_engine.so did not fix the issue

pi@raspberrypi:~/my_apps_flutter_assets $ ls -lah
total 39M
drwxr-xr-x  5 pi pi 4.0K Dec 20 09:22 .
drwx------ 19 pi pi 4.0K Dec 20 09:22 ..
-rw-r--r--  1 pi pi  23M Dec 20 09:22 app.so
-rw-r--r--  1 pi pi 111K Dec 20 09:22 AssetManifest.bin
-rw-r--r--  1 pi pi  99K Dec 20 09:22 AssetManifest.json
-rw-r--r--  1 pi pi  311 Dec 20 09:22 FontManifest.json
drwxr-xr-x  2 pi pi 4.0K Dec 20 09:22 fonts
-rw-r--r--  1 pi pi 799K Dec 20 09:22 icudtl.dat
-rw-r--r--  1 pi pi   32 Dec 20 09:22 .last_build_id
-rw-r--r--  1 pi pi  16M Dec 20 09:22 libflutter_engine.so
-rw-r--r--  1 pi pi  93K Dec 20 09:22 NOTICES.Z
drwxr-xr-x  7 pi pi 4.0K Dec 20 09:22 packages
drwxr-xr-x  2 pi pi 4.0K Dec 20 09:22 shaders

Running output (wrong ELF class: ELFCLASS32 error)

pi@raspberrypi:~/my_apps_flutter_assets $ DISPLAY=:0 flutter-pi --release /home/pi/my_apps_flutter_assets/
==============Locale==============
Flutter locale:
  default: en
  locales: en en.UTF-8 en_GB en.UTF-8 en.UTF-8 en_GB en.UTF-8
===================================
===================================
EGL information:
  version: 1.4
  vendor: Mesa Project
  client extensions: EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device EGL_EXT_platform_wayland EGL_KHR_platform_wayland EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_EXT_platform_xcb EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless
  display extensions: EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_context_flush_control EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_MESA_query_driver EGL_WL_bind_wayland_display
===================================
===================================
OpenGL ES information:
  version: "OpenGL ES 2.0 Mesa 23.2.1-1~bpo12+rpt2"
  shading language version: "OpenGL ES GLSL ES 1.0.16"
  vendor: "Broadcom"
  renderer: "VC4 V3D 2.1"
  extensions: "GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1 GL_EXT_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_stencil8 GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_EGL_image GL_OES_depth_texture GL_AMD_performance_monitor GL_OES_packed_depth_stencil GL_OES_get_program_binary GL_APPLE_texture_max_level GL_EXT_discard_framebuffer GL_EXT_read_format_bgra GL_NV_pack_subimage GL_EXT_frag_depth GL_NV_fbo_color_attachments GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_array_object GL_ANGLE_pack_reverse_row_order GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers GL_EXT_map_buffer_range GL_KHR_debug GL_KHR_texture_compression_astc_ldr GL_NV_generate_mipmap_sRGB GL_NV_pixel_buffer_object GL_OES_required_internalformat GL_OES_surfaceless_context GL_EXT_debug_label GL_EXT_separate_shader_objects GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_draw_elements_base_vertex GL_EXT_texture_border_clamp GL_KHR_context_flush_control GL_OES_draw_elements_base_vertex GL_OES_texture_border_clamp GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_EXT_texture_compression_s3tc_srgb GL_KHR_parallel_shader_compile GL_MESA_tile_raster_order GL_MESA_bgra "
===================================
window.c: WARNING: display didn't provide valid physical dimensions. The device-pixel ratio will default to 1.0, which may not be the fitting device-pixel ratio for your display.
Use the `-d` commandline parameter to specify the physical dimensions of your display.
display mode:
  resolution: 1920 x 1080
  refresh rate: 60.000000Hz
  physical size: 0mm x 0mm
  flutter device pixel ratio: 1.000000
  pixel format: (any)
flutter-pi.c: Info: Could not load flutter engine from app bundle. dlopen("/home/pi/my_apps_flutter_assets/libflutter_engine.so"): /home/pi/my_apps_flutter_assets/libflutter_engine.so: wrong ELF class: ELFCLASS32.
flutter-pi.c: Info: Could not load flutter engine. dlopen("libflutter_engine.so.release"): libflutter_engine.so.release: cannot open shared object file: No such file or directory.
flutter-pi.c: Info: Could not load flutter engine. dlopen("libflutter_engine.so"): libflutter_engine.so: cannot open shared object file: No such file or directory.
flutter-pi.c: Error: Could not load flutter engine from any location. Make sure you have installed the engine binaries.

Details about the PI

pi@raspberrypi:~/my_apps_flutter_assets $ lscpu
Architecture:            aarch64
  CPU op-mode(s):        32-bit, 64-bit
  Byte Order:            Little Endian
CPU(s):                  4
  On-line CPU(s) list:   0-3
Vendor ID:               ARM
  Model name:            Cortex-A53
    Model:               4
    Thread(s) per core:  1
    Core(s) per cluster: 4
    Socket(s):           -
    Cluster(s):          1
    Stepping:            r0p4
    CPU(s) scaling MHz:  50%
    CPU max MHz:         1400.0000
    CPU min MHz:         600.0000
    BogoMIPS:            38.40
    Flags:               fp asimd evtstrm crc32 cpuid
Caches (sum of all):
  L1d:                   128 KiB (4 instances)
  L1i:                   128 KiB (4 instances)
  L2:                    512 KiB (1 instance)
Vulnerabilities:
  Gather data sampling:  Not affected
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Mmio stale data:       Not affected
  Retbleed:              Not affected
  Spec rstack overflow:  Not affected
  Spec store bypass:     Not affected
  Spectre v1:            Mitigation; __user pointer sanitization
  Spectre v2:            Not affected
  Srbds:                 Not affected
  Tsx async abort:       Not affected
  
pi@raspberrypi:~/my_apps_flutter_assets $ uname -a
Linux raspberrypi 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux

@rsov
Copy link
Author

rsov commented Dec 19, 2023

Tried building with arm64 flutterpi_tool build --release --cpu=pi3 --arch=arm64

Got a different error

pi@raspberrypi:~ $ flutter-pi --release /home/pi/my_apps_flutter_assets/
==============Locale==============
Flutter locale:
  default: en
  locales: en en.UTF-8 en_GB en.UTF-8 en.UTF-8 en_GB en.UTF-8
===================================
===================================
EGL information:
  version: 1.4
  vendor: Mesa Project
  client extensions: EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device EGL_EXT_platform_wayland EGL_KHR_platform_wayland EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_EXT_platform_xcb EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless
  display extensions: EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_context_flush_control EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_MESA_query_driver EGL_WL_bind_wayland_display
===================================
===================================
OpenGL ES information:
  version: "OpenGL ES 2.0 Mesa 23.2.1-1~bpo12+rpt2"
  shading language version: "OpenGL ES GLSL ES 1.0.16"
  vendor: "Broadcom"
  renderer: "VC4 V3D 2.1"
  extensions: "GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1 GL_EXT_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_stencil8 GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_EGL_image GL_OES_depth_texture GL_AMD_performance_monitor GL_OES_packed_depth_stencil GL_OES_get_program_binary GL_APPLE_texture_max_level GL_EXT_discard_framebuffer GL_EXT_read_format_bgra GL_NV_pack_subimage GL_EXT_frag_depth GL_NV_fbo_color_attachments GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_array_object GL_ANGLE_pack_reverse_row_order GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers GL_EXT_map_buffer_range GL_KHR_debug GL_KHR_texture_compression_astc_ldr GL_NV_generate_mipmap_sRGB GL_NV_pixel_buffer_object GL_OES_required_internalformat GL_OES_surfaceless_context GL_EXT_debug_label GL_EXT_separate_shader_objects GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_draw_elements_base_vertex GL_EXT_texture_border_clamp GL_KHR_context_flush_control GL_OES_draw_elements_base_vertex GL_OES_texture_border_clamp GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_EXT_texture_compression_s3tc_srgb GL_KHR_parallel_shader_compile GL_MESA_tile_raster_order GL_MESA_bgra "
===================================
window.c: WARNING: display didn't provide valid physical dimensions. The device-pixel ratio will default to 1.0, which may not be the fitting device-pixel ratio for your display.
Use the `-d` commandline parameter to specify the physical dimensions of your display.
display mode:
  resolution: 1920 x 1080
  refresh rate: 60.000000Hz
  physical size: 0mm x 0mm
  flutter device pixel ratio: 1.000000
  pixel format: (any)
pluginregistry.c: Initialized plugins: services, text input, raw keyboard plugin, gstreamer video_player, audioplayers,
window.c: Flutter requested render surface before supplying surface dimensions.
gl_renderer.c: Choosing EGL config with pixel format ARGB 8:8:8:8...
Illegal instruction

@arun-gautham
Copy link

iam getting same error was there a solution to this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants