Skip to content

Image Rendering error on Redmi K80Pro. #160441

Closed as not planned
Closed as not planned

Description

@deretame

Steps to reproduce

In the latest Flutter version, in release mode on my phone, using the default engine (which should now be Impeller, but the same issue occurs with Skia), loading images from the cache directory results in display errors. Below is the minimal reproduction and Flutter doctor information, as well as my phone details:

{
    "version": {
        "baseOS": "",
        "securityPatch": "2024-11-01",
        "sdkInt": 35,
        "release": 15,
        "codename": "REL",
        "previewSdkInt": 0,
        "incremental": "OS2.0.11.0.VOMCNXM"
    },
    "supportedAbis": [
        "arm64-v8a"
    ],
    "supported32BitAbis": [],
    "display": "AQ3A.240829.*",
    "type": "user",
    "isPhysicalDevice": true,
    "isLowRamDevice": false
}

The phone model is Redmi K80 Pro, and the processor is Snapdragon 8 Elite.

If there is any information that needs to be supplemented, please let me know. I'd be happy to help debug.

Expected results

Theoretically, it should perform very well.

Actual results

But in reality, it will show strange display effects, as shown below.

Code sample

Code sample
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:path_provider/path_provider.dart';

void main() {
  runApp(MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Download and Display Image')),
        body: Center(
          child: FutureBuilder<String>(
            future: downloadImage(),
            builder: (context, snapshot) {
              if (snapshot.connectionState == ConnectionState.waiting) {
                return CircularProgressIndicator();
              } else if (snapshot.hasError) {
                return Text('Error: ${snapshot.error}');
              } else {
                return Image.file(
                  File(snapshot.data!),
                );
              }
            },
          ),
        ),
      ),
    );
  }

  Future<String> downloadImage() async {
    var headers = {
      'User-Agent': '#',
      'Accept': '*/*',
      'Host': 'img.picacomic.com',
      'Connection': 'keep-alive'
    };

    var request = http.Request(
        'GET',
        Uri.parse(
            'https://img.picacomic.com/lMjaaAbePhYLfoNtAd6nAi6udOEqwAIEwS1eTBKp5O0/rs:fill:300:400:0/g:sm/aHR0cHM6Ly9zdG9yYWdlLWIucGljYWNvbWljLmNvbS9zdGF0aWMvODM5ZWI2NzktMTdlZC00MjUwLTliOTktMGRmMTI0OTkzNDYyLmpwZw.jpg'));

    request.headers.addAll(headers);

    http.StreamedResponse response = await request.send();

    if (response.statusCode == 200) {
      final directory = await getTemporaryDirectory();
      final filePath = '${directory.path}/downloaded_image.png';

      final file = File(filePath);
      await file.writeAsBytes(await response.stream.toBytes());

      return filePath;
    } else {
      throw Exception('Failed to download image: ${response.reasonPhrase}');
    }
  }
}

Screenshots or Video

Screenshots / Video demonstration

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.27.1, on Microsoft Windows [版本 10.0.26100.2605], locale zh-CN)
    • Flutter version 3.27.1 on channel stable at C:\Users\windy\sdk\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 17025dd882 (21 hours ago), 2024-12-17 03:23:09 +0900
    • Engine revision cb4b5fff73
    • Dart version 3.6.0
    • DevTools version 2.40.2

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at C:\Users\windy\AppData\Local\Android\Sdk
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = C:\Users\windy\AppData\Local\Android\Sdk
    • Java binary at: C:\Users\windy\AppData\Local\Programs\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.12.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.12.35527.113
    • Windows 10 SDK version 10.0.22621.0

[✓] Android Studio (version 2024.2)
    • Android Studio at C:\Users\windy\AppData\Local\Programs\Android Studio
    • 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
    • Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.2)
    • IntelliJ at C:\Users\windy\AppData\Local\Programs\IntelliJ IDEA Ultimate 2
    • Flutter plugin version 83.0.3
    • Dart plugin version 242.24931

[✓] IntelliJ IDEA Ultimate Edition (version 2024.3)
    • IntelliJ at C:\Users\windy\AppData\Local\Programs\IntelliJ IDEA Ultimate
    • Flutter plugin version 83.0.4
    • Dart plugin version 243.23177

[✓] VS Code (version 1.96.0)
    • VS Code at C:\Users\windy\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.102.0

[✓] VS Code (version 1.97.0-insider)
    • VS Code at C:\Users\windy\AppData\Local\Programs\Microsoft VS Code Insiders
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (5 available)
    • 24122RKC7C (mobile) • 1f883fc3           • android-arm64  • Android 15 (API 35)
    • 2206122SC (mobile)  • 192.168.50.53:5555 • android-x64    • Android 12 (API 32)
    • Windows (desktop)   • windows            • windows-x64    • Microsoft Windows [版本 10.0.26100.2605]
    • Chrome (web)        • chrome             • web-javascript • Google Chrome 131.0.6778.140
    • Edge (web)          • edge               • web-javascript • Microsoft Edge 129.0.2792.65

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

• No issues found!

Activity

  1. jonahwilliams commented on Dec 17, 2024

    @jonahwilliams
    Contributor

    Are you sure this is happening with Skia? This looks like the sort of rendering problem that could be caused by an issue in the Vulkan renderer. Either that or a bug in the image codec or network code.

  2. azzurritech-talha commented on Dec 17, 2024

    @azzurritech-talha
  3. deretame commented on Dec 18, 2024

    @deretame
    Author

    Are you sure this is happening with Skia? This looks like the sort of rendering problem that could be caused by an issue in the Vulkan renderer. Either that or a bug in the image codec or network code.您确定这是在 Skia 中发生的吗?这看起来像是可能由 Vulkan 渲染器问题引起的渲染问题。要么就是图像编解码器或网络代码中的错误。

    <meta-data
    android:name="io.flutter.embedding.android.EnableImpeller"
    android:value="false" />

    I am switching to Skia in this manner. If this is incorrect, please tell me the right way to do it.
    Additionally, when I switch back to the previous Flutter version, which by default uses the Skia engine, this issue does not occur. So I have suspected that it might be a problem with Impeller. However, even after disabling Impeller as described above, the issue persists, leaving me unable to pinpoint exactly what the problem is. Moreover, this issue does not arise when using images directly from the network or from assets. Currently, I only encounter this problem when using images from the cache directory.

  4. maheshj01 commented on Dec 18, 2024

    @maheshj01
    Member

    Hi @deretame, Thanks for filing the issue. I am not sure I understood what the issue is in the screenshot share above or the expected or the actual results don't really have enough clarity

    Expected results
    Theoretically, it should perform very well.

    Actual results
    But in reality, it will show strange display effects, as shown below.

    Would you mind clarifying what strange effects is or what you meant by perform well?

    Screenshot of downloaded image rendered vs Image.network in release mode

    Unfortunately, I don't see difference in those images.

    code sample
    import 'dart:io';
    
    import 'package:flutter/material.dart';
    import 'package:http/http.dart' as http;
    import 'package:path_provider/path_provider.dart';
    
    void main() {
      runApp(MyApp());
    }
    
    class MyApp extends StatelessWidget {
      const MyApp({super.key});
    
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          home: Scaffold(
            appBar: AppBar(title: const Text('Download and Display Image')),
            body: SingleChildScrollView(
              child: Column(
                children: [
                  const Padding(
                    padding: EdgeInsets.all(2.0),
                    child: Text("Downloaded Image"),
                  ),
                  FutureBuilder<String>(
                    future: downloadImage(),
                    builder: (context, snapshot) {
                      if (snapshot.connectionState == ConnectionState.waiting) {
                        return CircularProgressIndicator();
                      } else if (snapshot.hasError) {
                        return Text('Error: ${snapshot.error}');
                      } else {
                        return Image.file(
                          File(snapshot.data!),
                        );
                      }
                    },
                  ),
                  Padding(
                    padding: const EdgeInsets.all(2.0),
                    child: Text("From Network"),
                  ),
                  Image.network(
                      'https://img.picacomic.com/lMjaaAbePhYLfoNtAd6nAi6udOEqwAIEwS1eTBKp5O0/rs:fill:300:400:0/g:sm/aHR0cHM6Ly9zdG9yYWdlLWIucGljYWNvbWljLmNvbS9zdGF0aWMvODM5ZWI2NzktMTdlZC00MjUwLTliOTktMGRmMTI0OTkzNDYyLmpwZw.jpg'),
                ],
              ),
            ),
          ),
        );
      }
    
      Future<String> downloadImage() async {
        var headers = {
          'User-Agent': '#',
          'Accept': '*/*',
          'Host': 'img.picacomic.com',
          'Connection': 'keep-alive'
        };
    
        var request = http.Request(
            'GET',
            Uri.parse(
                'https://img.picacomic.com/lMjaaAbePhYLfoNtAd6nAi6udOEqwAIEwS1eTBKp5O0/rs:fill:300:400:0/g:sm/aHR0cHM6Ly9zdG9yYWdlLWIucGljYWNvbWljLmNvbS9zdGF0aWMvODM5ZWI2NzktMTdlZC00MjUwLTliOTktMGRmMTI0OTkzNDYyLmpwZw.jpg'));
    
        request.headers.addAll(headers);
    
        http.StreamedResponse response = await request.send();
    
        if (response.statusCode == 200) {
          final directory = await getTemporaryDirectory();
          final filePath = '${directory.path}/downloaded_image.png';
    
          final file = File(filePath);
          await file.writeAsBytes(await response.stream.toBytes());
    
          return filePath;
        } else {
          throw Exception('Failed to download image: ${response.reasonPhrase}');
        }
      }
    }
    
    flutter doctor -v
    [✓] Flutter (Channel stable, 3.27.0, on macOS 15.1.1 24B2091 darwin-arm64, locale en-US)
        • Flutter version 3.27.0 on channel stable at /Users/mahesh/Development/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 8495dee1fd (7 days ago), 2024-12-10 14:23:39 -0800
        • Engine revision 83bacfc525
        • Dart version 3.6.0
        • DevTools version 2.40.2
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-35, build-tools 34.0.0
        • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 16.0)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 16A242d
        • CocoaPods version 1.16.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2024.1)
        • Android Studio at /Applications/Android Studio.app/Contents
        • 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
        • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    
    [✓] IntelliJ IDEA Community Edition (version 2021.2.1)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 61.2.4
        • Dart plugin version 212.5080.8
    
    [✓] VS Code (version 1.94.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.100.0
    
    [✓] Connected device (4 available)
        • Pixel 7 (mobile)                • 33270DLH20012A        • android-arm64  • Android 15 (API 35)
        • macOS (desktop)                 • macos                 • darwin-arm64   • macOS 15.1.1 24B2091
          darwin-arm64
        • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 15.1.1 24B2091
          darwin-arm64
        • Chrome (web)                    • chrome                • web-javascript • Google Chrome
          128.0.6613.85
    
    [✓] Network resources
        • All expected network resources are available.
    
    • No issues found!
  5. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Dec 18, 2024
  6. jonahwilliams commented on Dec 18, 2024

    @jonahwilliams
    Contributor

    @deretame that is correct - make sure its under the application tag. additionally you can verify this by checking the logs. With Impeller you should see a log message like "Using the Impeller rendering engine (Vulkan)" and no log message with skia

  7. deretame commented on Dec 18, 2024

    @deretame
    Author

    Hi @deretame, Thanks for filing the issue. I am not sure I understood what the issue is in the screenshot share above or the expected or the actual results don't really have enough clarity您好,感谢您提交问题。我不确定是否理解了上述截图中的问题,或者预期的或实际的结果不够清晰。

    Expected results 预期结果
    Theoretically, it should perform very well.理论上,它应该表现非常好。
    Actual results 实际结果
    But in reality, it will show strange display effects, as shown below.但现实中,它将显示奇怪的显示效果,如下所示。

    Would you mind clarifying what strange effects is or what you meant by perform well?您能否澄清一下“strange effects”是指什么,或者您所说的“perform well”是什么意思?

    Screenshot of downloaded image rendered vs Image.network in release mode截图显示下载的图像与发布模式下的 Image.network 渲染效果对比

    Unfortunately, I don't see difference in those images.很遗憾,我没有在这些图片中看到差异。

    code sample 代码示例

    import 'dart:io';
    
    import 'package:flutter/material.dart';
    import 'package:http/http.dart' as http;
    import 'package:path_provider/path_provider.dart';
    
    void main() {
      runApp(MyApp());
    }
    
    class MyApp extends StatelessWidget {
      const MyApp({super.key});
    
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          home: Scaffold(
            appBar: AppBar(title: const Text('Download and Display Image')),
            body: SingleChildScrollView(
              child: Column(
                children: [
                  const Padding(
                    padding: EdgeInsets.all(2.0),
                    child: Text("Downloaded Image"),
                  ),
                  FutureBuilder<String>(
                    future: downloadImage(),
                    builder: (context, snapshot) {
                      if (snapshot.connectionState == ConnectionState.waiting) {
                        return CircularProgressIndicator();
                      } else if (snapshot.hasError) {
                        return Text('Error: ${snapshot.error}');
                      } else {
                        return Image.file(
                          File(snapshot.data!),
                        );
                      }
                    },
                  ),
                  Padding(
                    padding: const EdgeInsets.all(2.0),
                    child: Text("From Network"),
                  ),
                  Image.network(
                      'https://img.picacomic.com/lMjaaAbePhYLfoNtAd6nAi6udOEqwAIEwS1eTBKp5O0/rs:fill:300:400:0/g:sm/aHR0cHM6Ly9zdG9yYWdlLWIucGljYWNvbWljLmNvbS9zdGF0aWMvODM5ZWI2NzktMTdlZC00MjUwLTliOTktMGRmMTI0OTkzNDYyLmpwZw.jpg'),
                ],
              ),
            ),
          ),
        );
      }
    
      Future<String> downloadImage() async {
        var headers = {
          'User-Agent': '#',
          'Accept': '*/*',
          'Host': 'img.picacomic.com',
          'Connection': 'keep-alive'
        };
    
        var request = http.Request(
            'GET',
            Uri.parse(
                'https://img.picacomic.com/lMjaaAbePhYLfoNtAd6nAi6udOEqwAIEwS1eTBKp5O0/rs:fill:300:400:0/g:sm/aHR0cHM6Ly9zdG9yYWdlLWIucGljYWNvbWljLmNvbS9zdGF0aWMvODM5ZWI2NzktMTdlZC00MjUwLTliOTktMGRmMTI0OTkzNDYyLmpwZw.jpg'));
    
        request.headers.addAll(headers);
    
        http.StreamedResponse response = await request.send();
    
        if (response.statusCode == 200) {
          final directory = await getTemporaryDirectory();
          final filePath = '${directory.path}/downloaded_image.png';
    
          final file = File(filePath);
          await file.writeAsBytes(await response.stream.toBytes());
    
          return filePath;
        } else {
          throw Exception('Failed to download image: ${response.reasonPhrase}');
        }
      }
    }

    flutter doctor -v

    [✓] Flutter (Channel stable, 3.27.0, on macOS 15.1.1 24B2091 darwin-arm64, locale en-US)
        • Flutter version 3.27.0 on channel stable at /Users/mahesh/Development/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 8495dee1fd (7 days ago), 2024-12-10 14:23:39 -0800
        • Engine revision 83bacfc525
        • Dart version 3.6.0
        • DevTools version 2.40.2
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-35, build-tools 34.0.0
        • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 16.0)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 16A242d
        • CocoaPods version 1.16.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2024.1)
        • Android Studio at /Applications/Android Studio.app/Contents
        • 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
        • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    
    [✓] IntelliJ IDEA Community Edition (version 2021.2.1)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 61.2.4
        • Dart plugin version 212.5080.8
    
    [✓] VS Code (version 1.94.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.100.0
    
    [✓] Connected device (4 available)
        • Pixel 7 (mobile)                • 33270DLH20012A        • android-arm64  • Android 15 (API 35)
        • macOS (desktop)                 • macos                 • darwin-arm64   • macOS 15.1.1 24B2091
          darwin-arm64
        • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 15.1.1 24B2091
          darwin-arm64
        • Chrome (web)                    • chrome                • web-javascript • Google Chrome
          128.0.6613.85
    
    [✓] Network resources
        • All expected network resources are available.
    
    • No issues found!
    

    My Flutter version is:

    [✓] Flutter (Channel stable, 3.27.1, on Microsoft Windows [版本 10.0.26100.2605], locale zh-CN)
        • Flutter version 3.27.1 on channel stable at C:\Users\windy\sdk\flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 17025dd882 (21 hours ago), 2024-12-17 03:23:09 +0900
        • Engine revision cb4b5fff73
        • Dart version 3.6.0
        • DevTools version 2.40.2

    But your version is:

    [✓] Flutter (Channel stable, 3.27.0, on macOS 15.1.1 24B2091 darwin-arm64, locale en-US)
        • Flutter version 3.27.0 on channel stable at /Users/mahesh/Development/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 8495dee1fd (7 days ago), 2024-12-10 14:23:39 -0800
        • Engine revision 83bacfc525
        • Dart version 3.6.0
        • DevTools version 2.40.2

    I don't know if this is related, I will demonstrate the difference between debug mode and release mode after work.

  8. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Dec 18, 2024
  9. deretame commented on Dec 18, 2024

    @deretame
    Author

    I apologize for any confusion I may have caused earlier. Upon retesting, I've discovered that there are display errors with images whether they are from the web, retrieved from cache, or obtained from assets.
    It should display like this,

    but now it looks like this.

    These are error codes.

    Launching lib\main.dart on 24122RKC7C in debug mode...
    Running Gradle task 'assembleDebug'...
    √ Built build\app\outputs\flutter-apk\app-debug.apk
    Installing build\app\outputs\flutter-apk\app-debug.apk...
    I/flutter ( 5238): [IMPORTANT:flutter/shell/platform/android/android_context_vk_impeller.cc(60)] Using the Impeller rendering backend (Vulkan).
    E/flutter ( 5238): [ERROR:flutter/impeller/renderer/backend/vulkan/allocator_vk.cc(356)] Break on 'ImpellerValidationBreak' to inspect point of failure: Unable to allocate Vulkan Image: ErrorInitializationFailed Type: Texture2D Mode: DevicePrivate Usage: { ShaderRead, RenderTarget } [VK]Flags: {} [VK]Format: R8G8B8A8Unorm [VK]Usage: { TransferSrc | TransferDst | Sampled | ColorAttachment | InputAttachment } [VK]Mem. Flags: { DeviceLocal }
    E/flutter ( 5238): [ERROR:flutter/impeller/renderer/render_target.cc(371)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not create color texture.
    Debug service listening on ws://127.0.0.1:10303/kvil4IowTGg=/ws
    Syncing files to device 24122RKC7C...
    W/1.raster( 5238): type=1400 audit(0.0:1905593): avc:  denied  { getattr } for  path="/sys/module/metis/parameters/minor_window_app" dev="sysfs" ino=83468 scontext=u:r:untrusted_app:s0:c214,c257,c512,c768 tcontext=u:object_r:sysfs_migt:s0 tclass=file permissive=0 app=com.example.testdemo
    D/LB      ( 5238): CustomizeAffinityThread startThread
    W/1.raster( 5238): type=1400 audit(0.0:1905594): avc:  denied  { getattr } for  path="/sys/module/mist/parameters/mist_set_uid" dev="sysfs" ino=83404 scontext=u:r:untrusted_app:s0:c214,c257,c512,c768 tcontext=u:object_r:sysfs_migt:s0 tclass=file permissive=0 app=com.example.testdemo
    D/VRI[MainActivity]( 5238): vri.reportNextDraw android.view.ViewRootImpl.performTraversals:4924 android.view.ViewRootImpl.doTraversal:3535 android.view.ViewRootImpl$TraversalRunnable.run:11542 android.view.Choreographer$CallbackRecord.run:1747 android.view.Choreographer$CallbackRecord.run:1756 
    D/VRI[MainActivity]( 5238): vri.Setup new sync=wmsSync-VRI[MainActivity]#2
    D/HWUI    ( 5238): makeCurrent grContext:0xb400007d338a15f0 reset mTextureAvailable
    D/xample.testdemo( 5238): MiuiProcessManagerServiceStub setSchedFifo
    I/MiuiProcessManagerImpl( 5238): setSchedFifo pid:5238, mode:3
    D/VRI[MainActivity]( 5238): vri.reportDrawFinished
    I/HandWritingStubImpl( 5238): refreshLastKeyboardType: 1
    I/HandWritingStubImpl( 5238): getCurrentKeyboardType: 1
    I/HandWritingStubImpl( 5238): getCurrentKeyboardType: 1
    D/ProfileInstaller( 5238): Installing profile for com.example.testdemo
    I/xample.testdemo( 5238): ProcessProfilingInfo new_methods=10 is saved saved_to_disk=1 resolve_classes_delay=8000

    I hope to provide assistance.

  10. jonahwilliams commented on Dec 18, 2024

    @jonahwilliams
    Contributor

    The errror message is probably relevant:

    E/flutter ( 5238): [ERROR:flutter/impeller/renderer/backend/vulkan/allocator_vk.cc(356)] Break on 'ImpellerValidationBreak' to inspect point of failure: Unable to allocate Vulkan Image: ErrorInitializationFailed Type: Texture2D Mode: DevicePrivate Usage: { ShaderRead, RenderTarget } [VK]Flags: {} [VK]Format: R8G8B8A8Unorm [VK]Usage: { TransferSrc | TransferDst | Sampled | ColorAttachment | InputAttachment } [VK]Mem. Flags: { DeviceLocal }

    I'll plan on acquiring a Redmi K80 Pro to test. One more thing to try, with impeller enabled, add the following flag:

    flutter run --enable-vulkan-validation. That may print out some additional error messages that would give us more clues.

  11. changed the title [-]Android retrieves an image error from the cache display[/-] [+]Image Rendering error on Redmi K80.[/+] on Dec 18, 2024
  12. added
    e: impellerImpeller rendering backend issues and features requests
    and removed
    in triagePresently being triaged by the triage team
    on Dec 18, 2024
  13. 3 remaining items

  14. Laurie-Lin commented on Dec 19, 2024

    @Laurie-Lin
    Contributor

    Same on xiaomi 15 when enable Impeller

  15. Laurie-Lin commented on Dec 20, 2024

    @Laurie-Lin
    Contributor

    On Xiaomi 15, using either Image.network or Image.assets will 100% reproduce the issue.

    By the way, Impeller has very noticeable ghosting issues on Xiaomi 15, and the frame rate is significantly low. I don't know why this is happening, but everything works fine after I disable Impeller.

    Additionally, users who do not pay attention to the update logs will not know that Flutter enables Impeller by default on Android, which will have very serious consequences as all images displayed in their applications will be corrupted.

  16. deretame commented on Dec 21, 2024

    @deretame
    Author

    The errror message is probably relevant:错误信息可能相关:

    E/flutter ( 5238): [ERROR:flutter/impeller/renderer/backend/vulkan/allocator_vk.cc(356)] Break on 'ImpellerValidationBreak' to inspect point of failure: Unable to allocate Vulkan Image: ErrorInitializationFailed Type: Texture2D Mode: DevicePrivate Usage: { ShaderRead, RenderTarget } [VK]Flags: {} [VK]Format: R8G8B8A8Unorm [VK]Usage: { TransferSrc | TransferDst | Sampled | ColorAttachment | InputAttachment } [VK]Mem. Flags: { DeviceLocal }E/flutter (5238): [ERROR:flutter/impeller/renderer/backend/vulkan/allocator_vk.cc(356)] 在 'ImpellerValidationBreak' 处中断以检查失败点:无法分配 Vulkan 图像:ErrorInitializationFailed 类型:Texture2D 模式:DevicePrivate 使用:{ ShaderRead, RenderTarget } [VK]标志:{} [VK]格式:R8G8B8A8Unorm [VK]使用:{ TransferSrc | TransferDst | Sampled | ColorAttachment | InputAttachment } [VK]内存标志:{ DeviceLocal }

    I'll plan on acquiring a Redmi K80 Pro to test. One more thing to try, with impeller enabled, add the following flag:我计划购买一台 Redmi K80 Pro 进行测试。还有一件事要尝试,启用叶轮后,添加以下标志:

    flutter run --enable-vulkan-validation. That may print out some additional error messages that would give us more clues. flutter run --enable-vulkan-validation 。可能会打印出一些额外的错误信息,这会给我们提供更多线索。

    I’m very sorry that I haven’t had time to deal with this matter for the past two days due to a busy work schedule. This is the output.

    flutter run --enable-vulkan-validation
    Launching lib\main.dart on 24122RKC7C in debug mode...
    Running Gradle task 'assembleDebug'...                             12.2s
    √ Built build\app\outputs\flutter-apk\app-debug.apk
    Installing build\app\outputs\flutter-apk\app-debug.apk...           5.8s
    I/flutter (17235): [IMPORTANT:flutter/shell/platform/android/android_context_vk_impeller.cc(57)] Using the Impeller rendering backend (Vulkan with Validation Layers).
    E/flutter (17235): [ERROR:flutter/impeller/renderer/backend/vulkan/allocator_vk.cc(356)] Break on 'ImpellerValidationBreak' to inspect point of failure: Unable to allocate Vulkan Image: ErrorInitializationFailed Type: Texture2D Mode: DevicePrivate Usage: { ShaderRead, RenderTarget } [VK]Flags: {} [VK]Format: R8G8B8A8Unorm [VK]Usage: { TransferSrc | TransferDst | Sampled | ColorAttachment | InputAttachment } [VK]Mem. Flags: { DeviceLocal }
    E/flutter (17235): [ERROR:flutter/impeller/renderer/render_target.cc(371)] Break on 'ImpellerValidationBreak' to inspect point of failure: Could not create color texture.
    Syncing files to device 24122RKC7C...                               95ms
    
    Flutter run key commands.
    r Hot reload.
    R Hot restart.
    h List all available interactive commands.
    d Detach (terminate "flutter run" but leave application running).
    c Clear the screen
    q Quit (terminate the application on the device).
    
    A Dart VM Service on 24122RKC7C is available at: http://127.0.0.1:14066/Lu_aNtC586U=/
    The Flutter DevTools debugger and profiler on 24122RKC7C is available at: http://127.0.0.1:9104?uri=http://127.0.0.1:14066/Lu_aNtC586U=/
    D/ProfileInstaller(17235): Installing profile for com.example.testdemo
    I/xample.testdemo(17235): ProcessProfilingInfo new_methods=10 is saved saved_to_disk=1 resolve_classes_delay=8000
    I/xample.testdemo(17235): This is non sticky GC, maxfree is 33554432 minfree is 8388608
    W/FinalizerDaemon(17235): type=1400 audit(0.0:150320): avc:  denied  { getopt } for  path="/dev/socket/usap_pool_primary" scontext=u:r:untrusted_app:s0:c27,c257,c512,c768 tcontext=u:r:zygote:s0 tclass=unix_stream_socket permissive=0 app=com.example.testdemo
    W/xample.testdemo(17235): ApkAssets: Deleting an ApkAssets object '<empty> and /product/app/ContentCatcherOS2/ContentCatcherOS2.apk' with 1 weak references
    W/xample.testdemo(17235): ApkAssets: Deleting an ApkAssets object '<empty> and /system_ext/priv-app/RtMiCloudSDK/RtMiCloudSDK.apk' with 1 weak references
    W/xample.testdemo(17235): ApkAssets: Deleting an ApkAssets object '<empty> and /system_ext/app/miuisystem/miuisystem.apk' with 1 weak references

    #160441 (comment)
    Additionally, based on what the above individual said, I suspect that perhaps any 8elite chip might cause rendering issues.

  17. changed the title [-]Image Rendering error on Redmi K80.[/-] [+]Image Rendering error on Redmi K80Pro.[/+] on Dec 21, 2024
  18. jonahwilliams commented on Dec 21, 2024

    @jonahwilliams
    Contributor

    Thank you! I've since ordered a similar device that uses the same Adreno 830 so i can get to the bottom of this.

  19. AlexV525 commented on Jan 3, 2025

    @AlexV525
    Member

    Closing as duplicate of #159876. Please track that issue instead, thanks!

  20. jonahwilliams commented on Jan 7, 2025

    @jonahwilliams
    Contributor

    I've landed a workaround on master channel. I haven't verified each different device + driver combo, so if you have time I'd appreciate if you could test and confirm if you're still seeing the issue. If so please leave a comment on #159876

  21. jiyuren commented on Jan 7, 2025

    @jiyuren

    Are you sure this is happening with Skia? This looks like the sort of rendering problem that could be caused by an issue in the Vulkan renderer. Either that or a bug in the image codec or network code.您确定这是在 Skia 中发生的吗?这看起来像是可能由 Vulkan 渲染器问题引起的渲染问题。要么就是图像编解码器或网络代码中的错误。

    <meta-data
    android:name="io.flutter.embedding.android.EnableImpeller"
    android:value="false" />
    

    我正在以这种方式切换到 Skia。如果这是不正确的,请告诉我正确的方法。 另外,当我切换回之前的 Flutter 版本(默认使用Skia 引擎)时,不会出现此问题。所以我怀疑可能是叶轮的问题。然而,即使按照上述禁用叶轮后,问题仍然存在,使我无法准确找出问题所在。此外,当直接使用来自网络或资产的图像时,不会出现此问题。目前,我仅在使用缓存目录中的图像时遇到此问题。
    我这边小米 15设备禁用Impeller 就不花屏了

  22. github-actions commented on Jan 21, 2025

    @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.

  23. locked as resolved and limited conversation to collaborators on Jan 21, 2025
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: renderingUI glitches reported at the engine/skia or impeller rendering levele: device-specificOnly manifests on certain devicese: impellerImpeller rendering backend issues and features requestsplatform-androidAndroid applications specificallyteam-engineOwned by Engine team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions