luis901101 / honeywell_scanner

BSD 3-Clause "New" or "Revised" License
22 stars 9 forks source link

HoneywellScannerPlugin.java uses or overrides a deprecated API #9

Closed mbalmer closed 2 years ago

mbalmer commented 2 years ago

With flutter 3.0.0, building an app with this module produces a warning:

Note: /Users/mbalmer/.pub-cache/hosted/pub.dartlang.org/honeywell_scanner-4.0.0+14/android/src/main/java/com/plugin/flutter/honeywell_scanner/HoneywellScannerPlugin.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

luis901101 commented 2 years ago

Yess, in fact that warning is produced in previous versions of flutter as well, it's produced by this static method:


    // This static method is only to remain compatible with apps that don’t use the v2 Android embedding.
    @Deprecated()
    @SuppressLint("Registrar")
    public static void registerWith(Registrar registrar)
    {
        new HoneywellScannerPlugin().init(
            registrar.context(),
            registrar.messenger()
        );
    }

That is the way plugins gets registered in older versions of flutter, I keep that method there only for backward compatibility purposes.