Skip to content

--local-engine broken for all x86 Android devices #34279

Closed

Description

@mklim

Steps

  1. Open any flutter app.
  2. Build the engine for android x86.
  3. flutter run --local-engine=android_debug_unopt_x86 to an x86 Android device.

Result

E/flutter (10680): [ERROR:flutter/runtime/dart_vm_data.cc(19)] VM snapshot invalid and could not be inferred from settings.
E/flutter (10680): [ERROR:flutter/runtime/dart_vm.cc(241)] Could not setup VM data to bootstrap the VM from.
E/flutter (10680): [ERROR:flutter/runtime/dart_vm_lifecycle.cc(89)] Could not create Dart VM instance.
F/flutter (10680): [FATAL:flutter/shell/common/shell.cc(218)] Check failed: vm. Must be able to initialize the VM.

Cause

It seems like this is a combination of changes to how we select libflutter.so and also flutter-team-archive/engine#9260. I've been able to work around this by locally reverting flutter-team-archive/engine#9260. @jason-simmons found that the libflutter.so in the apk looks like it's being selected from flutter/flutter/bin/cache instead of flutter/engine/out. I'm not sure if the APK selection issue is the root cause of the VM failure or if there's some other issue here. Could potentially test for it by copying the locally built cached engine to flutter/flutter/bin/cache and seeing if the error still persists.

/cc @blasten

Activity

  1. added
    c: crashStack traces logged to the console
    engineflutter/engine related. See also e: labels.
    t: gradle"flutter build" and "flutter run" on Android
    platform-androidAndroid applications specifically
    on Jun 11, 2019
  2. blasten commented on Jun 12, 2019

    @blasten

    found that the libflutter.so in the apk looks like it's being selected from flutter/flutter/bin/cache instead of flutter/engine/out

    Did this work before @mklim? I'm looking at flutter.gradle before my changes, and it seems the script never read libflutter.so from flutter/engine/out. Only for arm/arm64 debug.

    flutterX86Jar = project.file("${project.buildDir}/${AndroidProject.FD_INTERMEDIATES}/flutter/flutter-x86.jar")
    Task flutterX86JarTask = project.tasks.create("${flutterBuildPrefix}X86Jar", Jar) {
    destinationDir flutterX86Jar.parentFile
    archiveName flutterX86Jar.name
    from("${flutterRoot}/bin/cache/artifacts/engine/android-x86/libflutter.so") {
    into "lib/x86"
    }
    from("${flutterRoot}/bin/cache/artifacts/engine/android-x64/libflutter.so") {
    into "lib/x86_64"
    }

  3. blasten commented on Jun 12, 2019

    @blasten

    oh I see what happened, in master we run that code regardless if you have a local engine passed to it.

  4. github-actions commented on Aug 29, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consoleengineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallyt: gradle"flutter build" and "flutter run" on Android

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions