Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlatformException(InputImageConverterError, java.lang.IllegalArgumentException, null, null) #713

Open
wantroba opened this issue Oct 31, 2024 · 8 comments

Comments

@wantroba
Copy link

Describe your issue. If applicable, add screenshots to help explain your problem.

The error occurs whenever I call the processImage(InputImage inputImage) function.

The last time it worked was May 27, 2024 with these plugin versions:
camera: ^0.11.0
google_mlkit_text_recognition: ^0.13.0

After I updated to these versions:
camera: ^0.11.0+2
google_mlkit_text_recognition: ^0.14.0

Then I tried to revert back to previous versions and the problem still persists.

Steps to reproduce.

The error occurs whenever I call the processImage(InputImage inputImage) function.

What is the expected result?

processImage(InputImage inputImage) function should work

Did you try our example app?

No

Is it reproducible in the example app?

No

Reproducible in which OS?

Android

Flutter/Dart Version?

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.4, on Microsoft Windows [versÆo 10.0.22631.4317], locale pt-BR)
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Visual Studio - develop Windows apps (Ferramentas de Build do Visual Studio 2019 16.11.29)
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.94.2)
[✓] Connected device (4 available)
[✓] Network resources

Plugin Version?

camera: ^0.11.0+2
google_mlkit_text_recognition: ^0.14.0

@wantroba
Copy link
Author

Could be related to #684

@simeonangelov94
Copy link

Same here, after updating to
camera: ^0.11.0+2
google_mlkit_text_recognition: ^0.14.0

Same dependencies. No issue running on Apple devices.

@cagrialta
Copy link

Related to #700 . You can use my solution as temporarily.

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 11, 2024
@wantroba
Copy link
Author

Any update?

@github-actions github-actions bot removed the stale label Dec 18, 2024
@wantroba
Copy link
Author

Related to #700 . You can use my solution as temporarily.

Your solution did not work for me :(

@simeonangelov94
Copy link

Related to #700 . You can use my solution as temporarily.

Your solution did not work for me :(

update your controller to use yuv420, that was the issue for me. Use camera package 0.10.6 for android.

controller = CameraController(
  cameras.first,
  ResolutionPreset.high,
  imageFormatGroup: Platform.isAndroid
      ? ImageFormatGroup.yuv420
      : ImageFormatGroup.bgra8888,
);


try {
  await controller.initialize();
  if (!mounted) return;

  controller.startImageStream((image) {
    if (!isBusy) {
      isBusy = true;
      img = image;
      addImageTree();
      doObjectDetectionOnFrame();
    }
  });
} catch (e) {
  // Handle initialization error
  print('Camera initialization failed: $e');
}

doObjectDetectionOnFrame() async {
InputImage? frameImg;

frameImg = cameraImageToInputImage(
    img!, cameras[0], controller!.value.deviceOrientation);

// getInputImage();
if (frameImg != null) {
  List<DetectedObject> objects =
      await objectDetector.processImage(frameImg);
  // print("len= ${objects.length}");
  setState(() {
    _scanResults = objects;
  });
}
isBusy = false;

}

@RossHS
Copy link

RossHS commented Dec 21, 2024

Bump, I have the same problem. Rolled back for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants