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
819 stars 476 forks source link

Deprecated RenderScript APIs in Mobile Scanner Plugin #1142

Open doctypepro opened 1 month ago

doctypepro commented 1 month ago

Flutter Version: 3.24.0 (Channel stable) Kotlin Version: 2.0.10

The mobile_scanner plugin version 5.1.1 includes usage of deprecated RenderScript APIs in its Android Kotlin codebase. The following issues are identified:

Deprecated Imports:

android.renderscript.Allocation
android.renderscript.Element
android.renderscript.RenderScript
android.renderscript.ScriptIntrinsicYuvToRGB
android.renderscript.Type

Deprecated API Usage:

RenderScript.create(context)
ScriptIntrinsicYuvToRGB.create(rs, Element.U8_4(rs))
Allocation.createTyped()
Type.Builder methods and constructors (e.g., Type.Builder(rs, Element.U8(rs)))
Allocation.USAGE_SCRIPT

Warning Details:

Various warnings indicate that classes and methods from the android.renderscript package are deprecated and will be removed in future Android versions. This includes allocation, element, script, and type handling classes and methods. These deprecations suggest that the code may not be compatible with future versions of Android and could lead to runtime issues or require significant updates.

Here is the screenshot of the issue.

Deprecated RenderScript imports in mobile_scanner plugin
navaronbracke commented 1 month ago

If these are all relating to the YUV to RGB converter utility that we have, I'm planing on removing that utility entirely with the switch to NV21. See also https://github.com/juliansteenbakker/mobile_scanner/issues/1116