Skip to content

FlutterEngineCreateAOTData return kInvalidArguments Invalid ELF path specified, when running release build on Debian 12Β #294

@zjyhll

Description

@zjyhll

Invalid ELF path when running release build on Debian 12 (libapp.so not valid ELF, but debug build runs fine)

πŸ–₯ Environment

  • Host OS: Debian 12
  • Kernel: 6.1.118
  • Target device: RK3568 (aarch64)
  • Flutter-elinux version:
    Flutter 3.29.3 β€’ channel [user-branch] β€’ Engine cf56914b32
    Tools β€’ Dart 3.7.2 β€’ DevTools 2.42.3
    

πŸ”§ Build commands used

# build (fails to run)
flutter-elinux build elinux --release
flutter-elinux build elinux --debug
flutter-elinux run -d elinux-wayland

❗ Description of the Problem

When building a Flutter eLinux project on Debian 12,
the release build fails to start on the same device (RK3568, aarch64)
with the following runtime error:

[ERROR:flutter/shell/platform/embedder/embedder_engine.cc(226)] FlutterEngineCreateAOTData return kInvalidArguments
Invalid ELF path specified

However, the release run (flutter-elinux run -d elinux-wayland --release)
runs perfectly fine on the same system.
This indicates that the runtime environment and engine itself are functional,
but the generated release AOT binary (libapp.so) is corrupted or invalid.

πŸ” What I Observed

The generated file build/elinux/arm64/release/bundle/lib/libapp.so
does not appear to be a valid ELF shared object.

Checking it with readelf gives no valid headers or section data:

$ readelf -d lib/libapp.so
Dynamic section at offset 0x330000 contains 6 entries:
  Tag        Type                         Name/Value
 0x0000000000000004 (HASH)               0x300
 0x0000000000000005 (STRTAB)             0x1e8
 0x000000000000000a (STRSZ)              133 (bytes)
 0x0000000000000006 (SYMTAB)             0x270
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000000 (NULL)               0x0

No ELF class or architecture information is detected,
suggesting the AOT compilation or linking failed silently.

πŸ†š Comparison with Debian 11

On Debian 11 using the same source code and build commands:

βœ… flutter-elinux build elinux --release produces a valid libapp.so
βœ… The release binary runs normally
❌ The issue only appears on Debian 12

βœ… Expected Behavior

  • flutter-elinux build elinux --release should generate a valid ELF libapp.so
  • The release bundle should start without Invalid ELF path specified

🚫 Actual Behavior

  • lib/libapp.so generated on Debian 12 is not a valid ELF file
  • Running the release bundle fails immediately with:
    FlutterEngineCreateAOTData return kInvalidArguments
    Invalid ELF path specified
    
  • Debug builds run normally

🧩 Steps to Reproduce

  1. On Debian 12:

    git clone https://github.com/sony/flutter-elinux.git
    cd flutter-elinux/flutter
    ./bin/flutter doctor
  2. Build release version:

    flutter-elinux build elinux --release
  3. Run the binary:

    ../sample --bundle=/flutter/bundle/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions