Skip to content

0.15.0 Android: MissingPluginException on every call — Kotlin plugin registers wrong channel name (google_mlkit_digital_ink_recognition instead of google_mlkit_digital_ink_recognizer) #886

Description

@TonghunHwang

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

Package

google_mlkit_digital_ink_recognition: 0.15.0

Platform

Android only. iOS is fine.

What happens

After upgrading 0.14.2 → 0.15.0, every method call of this plugin fails on Android with:

MissingPluginException(No implementation found for method vision#manageInkModels on channel google_mlkit_digital_ink_recognizer)

This affects DigitalInkRecognizerModelManager.isModelDownloaded() / downloadModel() / deleteModel() as well as DigitalInkRecognizer.recognize() — they all share the same channel.

Root cause

In the 0.15.0 Java→Kotlin migration the Android plugin registers its MethodChannel under a different name than the Dart (and iOS) side uses:

Dart — lib/src/digital_ink_recognizer.dart:

static const MethodChannel _channel = MethodChannel(
  'google_mlkit_digital_ink_recognizer',
);

iOS — ios/Classes/GoogleMlKitDigitalInkRecognitionPlugin.swift (matches Dart ✓):

name: "google_mlkit_digital_ink_recognizer",

Android — android/src/main/kotlin/com/google_mlkit_digital_ink_recognition/GoogleMlKitDigitalInkRecognitionPlugin.kt (does not match ✗):

companion object {
    private const val CHANNEL_NAME = "google_mlkit_digital_ink_recognition"
}

In 0.14.2 the Java plugin used the matching name:

private static final String channelName = "google_mlkit_digital_ink_recognizer";

So on Android no handler is ever attached to the channel the Dart side calls, and every invocation throws MissingPluginException.

Fix

One-line change — restore the original channel name in the Kotlin plugin:

private const val CHANNEL_NAME = "google_mlkit_digital_ink_recognizer"

Note this is a separate defect from #885 (empty manageModel() stub, also introduced by the Kotlin migration): fixing the channel name alone makes the calls reach the Android handler, but model management will still be broken until #885 is fixed too. Both fixes are needed to make 0.15.0 usable on Android.

Steps to reproduce.

  1. Add google_mlkit_digital_ink_recognition: 0.15.0 and run on Android (fresh install).
  2. Call await DigitalInkRecognizerModelManager().isModelDownloaded('en') (or downloadModel, or recognize).
  3. MissingPluginException(No implementation found for method vision#manageInkModels on channel google_mlkit_digital_ink_recognizer).

What is the expected result?

Method calls reach the Android implementation, as in 0.14.2. Downgrading to 0.14.2 (no other changes) makes everything work again — verified on a Samsung device, Android, model downloads and recognition succeed.

Did you try our example app?

No

Is it reproducible in the example app?

Not tested, but it necessarily reproduces: the channel-name mismatch is in the published package sources (verified in the pub.dev archive of 0.15.0).

Reproducible in which OS?

Android

Plugin Version?

google_mlkit_digital_ink_recognition: 0.15.0 (regression from 0.14.2), google_mlkit_commons: 0.12.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions