mobile_scanner
mobile_scanner copied to clipboard
Camera won't work when impeller enabled on Android
This message has been updated to outline the most up-to-date information on this bug. The original comment is kept at the bottom
When this bug was filed, Impeller on Android was still in preview, with some open work relating to platform views still pending. This work has since concluded and resulted in both 1P plugins (camera, video_player) being updated to support Impeller. There is also a migration doc for plugin authors, available at https://docs.flutter.dev/release/breaking-changes/android-surface-plugins
This migration doc outlines what mobile_scanner
must do to support Impeller.
Most notably we should do the following:
- Set the minimum supported Flutter version to 3.24, per the note in the migration doc
- Migrate from
SurfaceTexture
toSurfaceProducer
(we do have usages of SurfaceTexture, which explains why it isn't working) - Correct the preview orientation for the camera, since the new SurfaceProducer does not provide the rotation. This is outlined in an update to the above migration doc at https://github.com/flutter/website/pull/11008 Depending on when the fix for mobile_scanner is written, we can consult the updated migration doc or the open PR
The message below is the un-edited original post for this issue
With the recent improvement of Impeller on Flutter 3.16 I tried to compile my app with <meta-data android:name="flutterEmbedding" android:value="2" /> <meta-data android:name="io.flutter.embedding.android.EnableImpeller" android:value="true" />
with this, the camera is black and does not work, in iOS with impeller works fine
Same problem for me.
Impeller for Android is still in preview. On Android API 29+ this uses Vulkan, which still has some issues with platform views.
is there any change with the new Flutter 3.19 and IMpeller, this library is not working with this option
As I started above, Impeller on Android is still in preview. Work on external textures has progressed however. A patch for this is about to land on flutter/engine. If you absolutely need Impeller on Android right now, your best bet is to switch to the master channel. But that is at your own risk, since the master channel is not for production apps.
As I started above, Impeller on Android is still in preview. Work on external textures has progressed however. A patch for this is about to land on flutter/engine. If you absolutely need Impeller on Android right now, your best bet is to switch to the master channel. But that is at your own risk, since the master channel is not for production apps.
I have the same problem. I have updated my local flutter version to the latest main channel but the problem persists:
Flutter is already up to date on channel main
Flutter 3.22.0-5.0.pre.34 • channel main • https://github.com/flutter/flutter.git
Framework • revision 45deb49716 (2 hours ago) • 2024-04-05 03:42:30 -0700
Engine • revision 292c48b9af
Tools • Dart 3.5.0 (build 3.5.0-18.0.dev) • DevTools 2.34.1
You mention that this has been fixed on the current master channel, can you confirm on what version you have tested this?
My mobile_scanner version is on 5.0.0-beta.2.