Skip to content

[Android][Impeller/Vulkan][vector_graphics / flutter_svg] — Rendering corruption and crashes after upgrading to Flutter 3.35.4 #177380

@ziii08

Description

@ziii08

Overview

After upgrading from Flutter 3.24.0 to Flutter 3.35.4, several previously working SVG assets now render incorrectly or cause crashes on specific Android devices. On Flutter 3.24.0, all SVGs displayed properly without corruption. However, on 3.35.4, certain SVGs become broken, while others cause the app to crash silently (no log output). This issue is particularly severe on Redmi Note 11, where displaying large or complex SVG/VG assets leads to consistent crashes.

Steps to reproduce

  1. Use the same SVG/VG assets that rendered fine in Flutter 3.24.0.
  2. Upgrade the project to Flutter 3.35.4.
  3. Display the assets in a simple widget tree, such as a GridView or ListView with multiple vector items.
  4. Run on Redmi Note 11 with Impeller enabled.

Result:

  • App crashes or assets render broken.
  • Disabling Impeller (--no-enable-impeller) prevents crashes but does not fully fix rendering corruption.

Expected results

  • SVG and VG assets should render correctly and consistently across Flutter versions.
  • Rendering should not crash on any supported Android device when using Impeller.
  • Visual output should remain identical across all devices and GPU vendors, ensuring consistent rendering quality regardless of hardware differences.

Actual results

  • Many SVG/VG assets appear broken or fail to render on Flutter 3.35.4.
  • Crashes occur silently (no log output) on specific devices, especially Redmi Note 11.
  • Performance lag is noticeable when rendering multiple vector assets.

Code sample

Code sample
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:vector_graphics/vector_graphics.dart';

void main() => runApp(const CompareApp());

class CompareApp extends StatelessWidget {
  const CompareApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: const ComparePage(),
      theme: ThemeData(useMaterial3: true),
    );
  }
}

class ComparePage extends StatelessWidget {
  const ComparePage({super.key});

  @override
  Widget build(BuildContext context) {
    final items = const [
      ('env_dog1.svg', _Renderer.svg),
      ('env_dog1.vg.bin', _Renderer.vg),
      ('rectangle_4433.svg', _Renderer.svg),
      ('rectangle_4433.vg.bin', _Renderer.vg),
    ];

    return Scaffold(
      appBar: AppBar(
        title: const Text('SVG vs VG comparison'),
        bottom: PreferredSize(
          preferredSize: const Size.fromHeight(36),
          child: Padding(
            padding: const EdgeInsets.only(bottom: 8.0),
            child: Text(
              'Run with:  flutter run --enable-impeller   and   --no-enable-impeller',
              style: Theme.of(context).textTheme.labelSmall,
            ),
          ),
        ),
      ),
      body: GridView.builder(
        padding: const EdgeInsets.all(16),
        gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
          crossAxisCount: 2,
          mainAxisSpacing: 16,
          crossAxisSpacing: 16,
          childAspectRatio: 1,
        ),
        itemCount: items.length,
        itemBuilder: (_, i) {
          final (path, type) = items[i];
          return _VectorTile(path: 'assets/$path', type: type);
        },
      ),
    );
  }
}

enum _Renderer { svg, vg }

class _VectorTile extends StatelessWidget {
  const _VectorTile({required this.path, required this.type});
  final String path;
  final _Renderer type;

  @override
  Widget build(BuildContext context) {
    return Card(
      elevation: 1,
      shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
      child: Padding(
        padding: const EdgeInsets.all(12.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Expanded(
              child: Center(
                child: AspectRatio(
                  aspectRatio: 1,
                  child: switch (type) {
                    _Renderer.svg => SvgPicture.asset(
                      path,
                      width: 220,
                      height: 220,
                      fit: BoxFit.contain,
                      clipBehavior: Clip.none,
                      placeholderBuilder: (_) => const CircularProgressIndicator(),
                      errorBuilder: (_, __, ___) => const DecoratedBox(
                        decoration: BoxDecoration(color: Color(0x11000000)),
                        child: Center(child: Text('SVG error')),
                      ),
                    ),
                    _Renderer.vg => VectorGraphic(
                      loader: AssetBytesLoader(path),
                      width: 220,
                      height: 220,
                      clipViewBox: false,
                    ),
                  },
                ),
              ),
            ),
            const SizedBox(height: 8),
            Text(
              path.split('/').last,
              maxLines: 2,
              overflow: TextOverflow.ellipsis,
              style: Theme.of(context).textTheme.labelMedium,
            ),
            Text(
              type.name.toUpperCase(),
              style: Theme.of(context).textTheme.labelSmall,
            ),
          ],
        ),
      ),
    );
  }
}

Sample Assets
svg_vg_repro_assets.zip

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.35.4, on Microsoft Windows [Version 10.0.26100.6899], locale en-ID) [510ms]
    • Flutter version 3.35.4 on channel stable at D:\src\flutter\fvm\versions\3.35.4
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d693b4b9db (5 weeks ago), 2025-09-16 14:27:41 +0000
    • Engine revision c298091351
    • Dart version 3.9.2
    • DevTools version 2.48.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations,
      enable-lldb-debugging

[✓] Windows Version (11 Home Single Language 64-bit, 24H2, 2009) [1,577ms]

[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [3.1s]
    • Android SDK at D:\src\android\Sdk
    • Emulator version 35.4.9.0 (build_id 13025442) (CL:N/A)
    • Platform android-36, build-tools 36.0.0
    • Java binary at: D:\src\Apps\Android\jbr\bin\java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
    • All Android licenses accepted.

[✓] Chrome - develop for the web [170ms]
    • Chrome at C:\Users\HP\AppData\Local\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.11) [168ms]
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.14.36401.2
    • Windows 10 SDK version 10.0.26100.0

[✓] Android Studio (version 2024.1) [52ms]
    • Android Studio at D:\src\Apps\Android
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = D:\src\Apps\Android
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)

[✓] IntelliJ IDEA Community Edition (version 2023.2) [49ms]
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.2.2
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin version 232.9559.10

[✓] VS Code (version 1.105.1) [15ms]
    • VS Code at C:\Users\HP\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.120.0

[✓] Connected device (4 available) [756ms]
    • 2201117TY (mobile) • ac548bae • android-arm64  • Android 13 (API 33)
    • Windows (desktop)  • windows  • windows-x64    • Microsoft Windows [Version 10.0.26100.6899]
    • Chrome (web)       • chrome   • web-javascript • Google Chrome 141.0.7390.122
    • Edge (web)         • edge     • web-javascript • Microsoft Edge 141.0.3537.71

[✓] Network resources [690ms]
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listc: fatal crashCrashes that terminate the processc: regressionIt was better in the past than it is nowe: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.found in release: 3.35Found to occur in 3.35found in release: 3.38Found to occur in 3.38has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: flutter_svgThe Flutter SVG drawing packagesp: vector_graphicsThe vector_graphics package setpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions