Skip to content

Android build fails on case-sensitive filesystems (Linux/CI): BlinkidFlutterPlugin.kt filename doesn't match declared pluginClass: BlinkIdFlutterPlugin #105

Description

@SLopez96

Description

flutter build (any target, including web-only builds) fails with the following error when run on a case-sensitive filesystem (Linux, most Docker/CI environments):

The plugin `blinkid_flutter` doesn't have a main class defined in
/root/.pub-cache/hosted/pub.dev/blinkid_flutter-8000.0.0/android/src/main/java/com/microblink/blinkid/flutter/BlinkIdFlutterPlugin.java
or
/root/.pub-cache/hosted/pub.dev/blinkid_flutter-8000.0.0/android/src/main/kotlin/com/microblink/blinkid/flutter/BlinkIdFlutterPlugin.kt.
This is likely due to an incorrect `androidPackage: com.microblink.blinkid.flutter` or `mainClass` entry in the plugin's pubspec.yaml.

This reproduces on both 8000.0.0 and 8001.0.0.

Root cause

pubspec.yaml declares:

flutter:
  plugin:
    platforms:
      android:
        package: com.microblink.blinkid.flutter
        pluginClass: BlinkIdFlutterPlugin

However, the actual Kotlin source file is named:

android/src/main/kotlin/com/microblink/blinkid/flutter/BlinkidFlutterPlugin.kt

Note the lowercase id in Blinkid vs. the declared BlinkId (capital I, D) in pluginClass. The Kotlin class inside that file is correctly named BlinkIdFlutterPlugin (matching pluginClass), but the filename on disk does not match.

Flutter's Gradle/plugin tooling resolves the plugin's main class file via an exact, case-sensitive path lookup derived from pluginClass — it does not scan the directory for a matching class. On case-insensitive filesystems (macOS APFS/HFS+, Windows NTFS by default) this typo is silently tolerated, which is why local development on Mac/Windows works fine. On case-sensitive filesystems (Linux, ext4 — used by essentially all Docker base images and most CI runners), the exact-case file BlinkIdFlutterPlugin.kt does not exist, so plugin resolution fails and the build breaks.

Steps to reproduce

  1. Add blinkid_flutter: ^8001.0.0 (or ^8000.0.0) to a Flutter project's pubspec.yaml.
  2. Run flutter pub get.
  3. Build the project (e.g. flutter build web, flutter build apk, or flutter build appbundle) inside a Linux container/CI runner with a case-sensitive filesystem (e.g. debian:latest, ubuntu, alpine).
  4. Observe the build failure above.

Note this also fails for web-only builds — Flutter validates plugin registration for all platforms declared in the plugin's pubspec.yaml (Android included) regardless of the actual build target.

Expected behavior

The plugin should resolve and build successfully on Linux/CI the same way it does on macOS/Windows.

Suggested fix

Rename the source file to match the declared pluginClass exactly:

android/src/main/kotlin/com/microblink/blinkid/flutter/BlinkidFlutterPlugin.kt
→ android/src/main/kotlin/com/microblink/blinkid/flutter/BlinkIdFlutterPlugin.kt

No code changes are needed — the class name inside the file (class BlinkIdFlutterPlugin() : FlutterPlugin, ...) already matches pluginClass; only the filename needs correcting.

(Note: helper files BlinkidDeserializationUtils.kt / BlinkidSerializationUtils.kt are not affected, since they aren't referenced by pluginClass and don't require exact-case path resolution — only the main plugin class file does.)

Environment

  • blinkid_flutter: 8000.0.0 and 8001.0.0
  • Flutter: 3.44.x (Dart 3.12.x)
  • Reproduces on: Docker debian:latest base image (Linux/ext4, case-sensitive filesystem)
  • Does not reproduce on: macOS (APFS, case-insensitive)

Workaround

Until fixed upstream, we're vendoring a patched copy of the package with the file renamed and using a dependency_overrides path override in pubspec.yaml to point at it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions