Repository navigation
Closed as not planned
Labels
c: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levele: device-specificOnly manifests on certain devicesOnly manifests on certain devicese: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsplatform-androidAndroid applications specificallyAndroid applications specificallyteam-engineOwned by Engine teamOwned by Engine team
Description
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
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!Metadata
Metadata
Assignees
Labels
c: renderingUI glitches reported at the engine/skia or impeller rendering levelUI glitches reported at the engine/skia or impeller rendering levele: device-specificOnly manifests on certain devicesOnly manifests on certain devicese: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsplatform-androidAndroid applications specificallyAndroid applications specificallyteam-engineOwned by Engine teamOwned by Engine team

Activity
jonahwilliams commentedon Dec 17, 2024
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.
azzurritech-talha commentedon Dec 17, 2024
deretame commentedon Dec 18, 2024
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.
maheshj01 commentedon Dec 18, 2024
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
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
flutter doctor -v
jonahwilliams commentedon Dec 18, 2024
@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
deretame commentedon Dec 18, 2024
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.2But 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.2I don't know if this is related, I will demonstrate the difference between debug mode and release mode after work.
deretame commentedon Dec 18, 2024
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.
I hope to provide assistance.
jonahwilliams commentedon Dec 18, 2024
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.[-]Android retrieves an image error from the cache display[/-][+]Image Rendering error on Redmi K80.[/+]3 remaining items
Laurie-Lin commentedon Dec 19, 2024
Same on xiaomi 15 when enable Impeller
Laurie-Lin commentedon Dec 20, 2024
On Xiaomi 15, using either
Image.networkorImage.assetswill 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.
deretame commentedon Dec 21, 2024
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.
#160441 (comment)
Additionally, based on what the above individual said, I suspect that perhaps any 8elite chip might cause rendering issues.
[-]Image Rendering error on Redmi K80.[/-][+]Image Rendering error on Redmi K80Pro.[/+]jonahwilliams commentedon Dec 21, 2024
Thank you! I've since ordered a similar device that uses the same Adreno 830 so i can get to the bottom of this.
AlexV525 commentedon Jan 3, 2025
Closing as duplicate of #159876. Please track that issue instead, thanks!
[Impeller] dont generate final 1x1 mip level to work around Adreno GP…
jonahwilliams commentedon Jan 7, 2025
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
jiyuren commentedon Jan 7, 2025
[Impeller] disable runtime mipmap generation on Adreno. (#161257)
[Impeller] disable runtime mipmap generation on Adreno. (flutter#161257)
github-actions commentedon Jan 21, 2025
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 -vand a minimal reproduction of the issue.