Open GeonSeon opened 1 month ago
It occurs with my code too. I even updated the google_mlkit_face_detection version to 0.11.1, but still no luck
@fbernaly @bharat-biradar
is same at google_mlkit_barcode_scanning package too. is there any solution??
@jihuncha since when you faced this issue?
@bilalali1 today. I fixed downgrade version 0.11.0 and downgrade camera plugin version to 0.10.6 and it works fine.
Similar problem here:
I/flutter ( 8867): PlatformException(InputImageConverterError, java.lang.IllegalArgumentException, null, null)
I/flutter ( 8867): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648:7)
I/flutter ( 8867): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)
I/flutter ( 8867):
But I'm using Text Recognition: camera: ^0.11.0+2 google_mlkit_text_recognition: ^0.13.1
Working Configuration:
google_mlkit_face_detection: 0.11.0
camera: 0.11.0+2
camera_android_camerax: 0.6.7+2
Problem:
The issue arises when using google_mlkit_face_detection: ^0.11.0
or google_mlkit_face_detection: 0.12.0
without explicitly specifying the version camera_android_camerax: 0.6.7+2
. This happens because camera: 0.11.0+2
uses camera_android_camerax: 0.6.8+2
under the hood, which causes build errors.
Solution:
By explicitly setting camera_android_camerax: 0.6.7+2
and google_mlkit_face_detection: 0.11.0
. Using this config it is still the new camera_android_camerax
under the hood in the camera
package.
Unfortunately, because of this issue:
https://issuetracker.google.com/issues/362452861
Downgrading isn't an option, as ML Kit pre 0.12.0 no longer works on iOS with the latest Firebase packages
So the solution by @pvlKryu isn't an option for us
Could anyone please help with resolving the issue of face detection not working on Android?
camera_android_camerax 0.6.10 and google_mlkit_text_recognition 0.13.0 works for me but google_mlkit_text_recognition 0.13.1 / 0.14.0 fails again
This works for me on Android:
flutter 3.24.4 camera 0.11.0+2 google_mlkit_commons-0.7.1 google_mlkit_barcode_scanning 0.11.1
I do receive the following Note:
google_mlkit_commons-0.7.1\android\src\main\java\com\google_mlkit_commons\InputImageConverter.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
When using the following: flutter 3.24.4 camera 0.11.0+2 google_mlkit_commons 0.8.1 google_mlkit_barcode_scanning 0.12.1
or
flutter 3.24.4 camera 0.11.0+2 google_mlkit_commons 0.9.0 google_mlkit_barcode_scanning 0.13.0
You will receive when the camera is turned on. You do see the camera preview, though. Using the camera_view.dart from the provided examples.
E/ImageError( 4621): Getting Image failed
E/ImageError( 4621): java.lang.IllegalArgumentException
I/flutter ( 4621): PlatformException(InputImageConverterError, java.lang.IllegalArgumentException, null, null)
The moment you move to google_mlkit_text_recognition to 0.14 and try ObjectDetector objectDetector.processImage(InputImage); doesn't work on Android device.
I tried with camera_android_camerax 0.6.10 also not working.
E/ImageError(17308): Getting Image failed
E/ImageError(17308): java.lang.IllegalArgumentException
E/flutter (17308): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(InputImageConverterError, java.lang.IllegalArgumentException, null, null)
E/flutter (17308): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648:7)
E/flutter (17308): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)
E/flutter (17308):
Describe your issue. If applicable, add screenshots to help explain your problem.
processImage function error only android packge version google_mlkit_face_detection: ^0.11.1 google_mlkit_commons: 0.8.1
but packge version
google_mlkit_face_detection: ^0.11.0 google_mlkit_commons: 0.7.1
works fine without any problems.
Everything goes well regardless of the ios.
Steps to reproduce.
E/ImageError( 9584): Getting Image failed E/ImageError( 9584): java.lang.IllegalArgumentException D/Camera2CameraImpl( 9584): {Camera@253ad19[id=1]} Use case androidx.camera.core.ImageAnalysis-4940151d-7719-4cfd-92ba-a8973df00dcd49725171 INACTIVE D/UseCaseAttachState( 9584): Active and attached use case: [androidx.camera.core.ImageCapture-2bdca64f-a070-4134-b383-ac7893b44085251716653, androidx.camera.core.Preview-1bc41ef1-bfb2-4253-b08b-9f9048b183f1235416022] for camera: 1 E/flutter ( 9584): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(InputImageConverterError, java.lang.IllegalArgumentException, null, null) E/flutter ( 9584): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648:7) E/flutter ( 9584): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18) E/flutter ( 9584):
E/flutter ( 9584): #2 MethodChannel.invokeListMethod (package:flutter/src/services/platform_channel.dart:520:35)
E/flutter ( 9584):
E/flutter ( 9584): #3 FaceDetector.processImage (package:google_mlkit_face_detection/src/face_detector.dart:23:20)
E/flutter ( 9584):
What is the expected result?
Face detection should be done.
Did you try our example app?
Yes
Is it reproducible in the example app?
Yes
Reproducible in which OS?
Android
Flutter/Dart Version?
Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.24.3, on macOS 15.0 24A335 darwin-arm64, locale en-IN) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 16.0) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.1) [✓] VS Code (version 1.93.1) [✓] Connected device (4 available)
[✓] Network resources
• No issues found!
Plugin Version?
Android
google_mlkit_face_detection: ^0.11.0 google_mlkit_commons: 0.7.1
IOS google_mlkit_face_detection: ^0.11.1 google_mlkit_commons: 0.8.1