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
- Add
blinkid_flutter: ^8001.0.0 (or ^8000.0.0) to a Flutter project's pubspec.yaml.
- Run
flutter pub get.
- 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).
- 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.
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):This reproduces on both
8000.0.0and8001.0.0.Root cause
pubspec.yamldeclares:However, the actual Kotlin source file is named:
Note the lowercase
idinBlinkidvs. the declaredBlinkId(capitalI,D) inpluginClass. The Kotlin class inside that file is correctly namedBlinkIdFlutterPlugin(matchingpluginClass), 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 fileBlinkIdFlutterPlugin.ktdoes not exist, so plugin resolution fails and the build breaks.Steps to reproduce
blinkid_flutter: ^8001.0.0(or^8000.0.0) to a Flutter project'spubspec.yaml.flutter pub get.flutter build web,flutter build apk, orflutter build appbundle) inside a Linux container/CI runner with a case-sensitive filesystem (e.g.debian:latest,ubuntu,alpine).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
pluginClassexactly:No code changes are needed — the class name inside the file (
class BlinkIdFlutterPlugin() : FlutterPlugin, ...) already matchespluginClass; only the filename needs correcting.(Note: helper files
BlinkidDeserializationUtils.kt/BlinkidSerializationUtils.ktare not affected, since they aren't referenced bypluginClassand don't require exact-case path resolution — only the main plugin class file does.)Environment
blinkid_flutter:8000.0.0and8001.0.0debian:latestbase image (Linux/ext4, case-sensitive filesystem)Workaround
Until fixed upstream, we're vendoring a patched copy of the package with the file renamed and using a
dependency_overridespath override inpubspec.yamlto point at it.