juliansteenbakker / mobile_scanner

A universal scanner for Flutter based on MLKit. Uses CameraX on Android and AVFoundation on iOS.
BSD 3-Clause "New" or "Revised" License
756 stars 446 forks source link

Camera won't work when impeller enabled on Android #867

Open JgomesAT opened 6 months ago

JgomesAT commented 6 months ago

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

frankmer commented 6 months ago

Same problem for me.

navaronbracke commented 6 months ago

Impeller for Android is still in preview. On Android API 29+ this uses Vulkan, which still has some issues with platform views.

JgomesAT commented 3 months ago

is there any change with the new Flutter 3.19 and IMpeller, this library is not working with this option

navaronbracke commented 3 months ago

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.

mfiumara commented 1 month ago

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.

bobekos commented 2 weeks ago

Hi any news to this? Tested on: Flutter 3.22 with mobile_scanner 5.1.1 still not working.

espresso3389 commented 2 weeks ago

Even official camera/video plugins do not run with Android Impeller (flutter/flutter#139702).

JgomesAT commented 2 weeks ago

I have the same problem, the camera stay in black, I not work in flutter 3.22 with Impeller in stable in Android

navaronbracke commented 1 week ago

We will have to migrate from createSurfaceTexture to createSurfaceProducer. This is a new API for Impeller with Vulkan, but will require Flutter 3.22.

navaronbracke commented 1 day ago

Small update: there is an upstream regression with the SurfaceProducer and Vulkan (OpenGL is unaffected). Will hold off on implementing this until the upstream bug is fixed.