Skip to content

Emulator Crashes Before Video Starts #156706

@max-anders

Description

@max-anders

What package does this bug report belong to?

video_player

What target platforms are you seeing this bug on?

Android

Have you already upgraded your packages?

Yes

Dependency versions

pubspec.lock
  video_player:
    dependency: "direct main"
    description:
      name: video_player
      sha256: "4a8c3492d734f7c39c2588a3206707a05ee80cef52e8c7f3b2078d430c84bc17"
      url: "https://pub.dev"
    source: hosted
    version: "2.9.2"
  video_player_android:
    dependency: transitive
    description:
      name: video_player_android
      sha256: b176e047ead64968d07bc36e7a60bcd471455f2bcba3997814e4c2a8596b5fc8
      url: "https://pub.dev"
    source: hosted
    version: "2.7.11"
  video_player_avfoundation:
    dependency: transitive
    description:
      name: video_player_avfoundation
      sha256: cd5ab8a8bc0eab65ab0cea40304097edc46da574c8c1ecdee96f28cd8ef3792f
      url: "https://pub.dev"
    source: hosted
    version: "2.6.2"
  video_player_platform_interface:
    dependency: transitive
    description:
      name: video_player_platform_interface
      sha256: "229d7642ccd9f3dc4aba169609dd6b5f3f443bb4cc15b82f7785fcada5af9bbb"
      url: "https://pub.dev"
    source: hosted
    version: "6.2.3"
  video_player_web:
    dependency: transitive
    description:
      name: video_player_web
      sha256: "6dcdd298136523eaf7dfc31abaf0dfba9aa8a8dbc96670e87e9d42b6f2caf774"
      url: "https://pub.dev"
    source: hosted
    version: "2.3.2"

Steps to reproduce

1.. launch the app in debug mode

Expected results

the video to load and run properly

Actual results

The app crashes immediately when run on the emulator, but it runs fine on a physical device.
The app used to work fine with no changes made to this code recently.
This issue seems to be related to the implementation of the video_player package and impeller

by the way I observed a similar issue on a physical device where the video wouldn't load a few weeks ago

Code sample

Code sample
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:showcaze3/core/constants/app_strings.dart';
import 'package:video_player/video_player.dart';
import 'package:showcaze3/presentation/widgets/utils/video_player_widget.dart';

class AssetVideoPlayerWidget extends ConsumerStatefulWidget {
  final String videoUrl;
  const AssetVideoPlayerWidget({super.key, required this.videoUrl});

  @override
  ConsumerState<ConsumerStatefulWidget> createState() =>
      _VideoPlayerWidgetState();
}

class _VideoPlayerWidgetState extends ConsumerState<AssetVideoPlayerWidget> {
  late VideoPlayerController _videoPlayerController;

  @override
  void initState() {
    super.initState();
    _videoPlayerController = VideoPlayerController.asset(AppStrings.video1)
      ..addListener(() {
        if (mounted) {
          setState(() {});
        }
      })
      ..setLooping(true)
      ..initialize().then((_) => _videoPlayerController.play());
  }

  @override
  void dispose() {
    _videoPlayerController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return VideoPlayerWidget(controller: _videoPlayerController);
  }
}
class VideoPlayerWidget extends ConsumerWidget {
  final VideoPlayerController controller;
  const VideoPlayerWidget({super.key, required this.controller});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    return controller.value.isInitialized
        ? AspectRatio(
            aspectRatio: controller.value.aspectRatio,
            child: VideoPlayer(controller),
          )
        : const SizedBox(
            height: 300,
            child: Center(child: CircularProgressIndicator()),
          );
  }
}


Screenshots or Videos

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
in the debug console : 
I/Surface ( 4242): Surface::setFrameRate is deprecated, setFrameRate hint is dropped as destination is not SurfaceFlinger
E/flutter ( 4242): [ERROR:flutter/impeller/base/validation.cc(59)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not create graphics pipeline: ErrorUnknown
Lost connection to device.

in the output console : 
[ERR] The Android emulator exited with code 1073741845 after startup
[ERR] Android emulator stderr:
[ERR] [29792:26712:20241014,140524.265:ERROR filesystem_win.cc:130] GetFileAttributes C:\Users\maxim\AppData\Local\Temp\\AndroidEmulator\emu-crash-35.2.10.db\attachments\673a28fb-0329-4b9d-b10b-f69650024b6a: The system cannot find the file specified. (2)
[ERR] [6864:32792:20241014,140524.462:ERROR filesystem_win.cc:130] GetFileAttributes C:\Users\maxim\AppData\Local\Temp\\AndroidEmulator\emu-crash-35.2.10.db\attachments\673a28fb-0329-4b9d-b10b-f69650024b6a: The system cannot find the file specified. (2)
[ERR] initialize: Supports id properties, got a vulkan device UUID
[ERR] netsimd I 10-14 12:05:26.269 daemon\src\rust_main.rs:98 - netsim artifacts path: "C:\\Users\\maxim\\AppData\\Local\\Temp\\netsimd"
[ERR] netsimd I 10-14 12:05:26.269 daemon\src\rust_main.rs:101 - NetsimdArgs {
[ERR]     fd_startup_str: None,
[ERR]     no_cli_ui: true,
[ERR]     no_web_ui: true,
[ERR]     pcap: false,
[ERR]     disable_address_reuse: false,
[ERR]     hci_port: None,
[ERR]     connector_instance: None,
[ERR]     instance: None,
[ERR]     logtostderr: false,
[ERR]     dev: false,
[ERR]     rust_grpc: false,
[ERR]     rust_hostapd: false,
[ERR]     rust_slirp: false,
[ERR]     vsock: None,
[ERR]     config: None,
[ERR]     host_dns: Some(
[ERR]         "192.168.0.1",
[ERR]     ),
[ERR]     http_proxy: None,
[ERR]     wifi_tap: None,
[ERR]     test_beacons: false,
[ERR]     no_test_beacons: false,
[ERR]     no_shutdown: false,
[ERR]     verbose: false,
[ERR]     version: false,
[ERR] }
[ERR] NVVM compilation failed: 1
[ERR] [6864:32792:20241014,140845.424:ERROR filesystem_win.cc:130] GetFileAttributes C:\Users\maxim\AppData\Local\Temp\\AndroidEmulator\emu-crash-35.2.10.db\attachments\dc482012-2563-4a71-a3ed-d80f38e56003: The system cannot find the file specified. (2)
[ERR] [6864:32792:20241014,140845.424:ERROR filesystem_win.cc:130] GetFileAttributes C:\Users\maxim\AppData\Local\Temp\\AndroidEmulator\emu-crash-35.2.10.db\attachments\dc482012-2563-4a71-a3ed-d80f38e56003: The system cannot find the file specified. (2)
[ERR] [6864:32792:20241014,140845.424:ERROR directory_reader_win.cc:43] FindFirstFile: The system cannot find the path specified. (3)
[ERR] [6864:32792:20241014,140849.600:ERROR filesystem_win.cc:130] GetFileAttributes C:\Users\maxim\AppData\Local\Temp\\AndroidEmulator\emu-crash-35.2.10.db\attachments\dc482012-2563-4a71-a3ed-d80f38e56003: The system cannot find the file specified. (2)
[ERR] Address these issues and try again.

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.22631.4317], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.2)
[√] Android Studio (version 2024.1)
[√] VS Code (version 1.94.2)
[√] Connected device (3 available)
    ! Device emulator-5562 is offline.
[√] Network resources

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    in triagePresently being triaged by the triage teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions