Description
Upgrading to file_picker: 11.0.0 causes an Android build failure. The GeneratedPluginRegistrant.java cannot resolve FilePickerPlugin because the Kotlin Android plugin is not applied in the package's android/build.gradle.
This is the same root cause as the regression in 10.3.9 (fixed in 10.3.10), but the fix was not carried into the 11.0.0 release.
Related: #1952 (maintainer requested a new issue in this comment)
Error
GeneratedPluginRegistrant.java:64: error: cannot find symbol
flutterEngine.getPlugins().add(new com.mr.flutter.plugin.filepicker.FilePickerPlugin());
^
symbol: class FilePickerPlugin
location: package com.mr.flutter.plugin.filepicker
1 error
FAILURE: Build failed with an exception.
Execution failed for task ':app:compileDebugJavaWithJavac'.
Root Cause
file_picker 11.0.0's android/build.gradle applies only com.android.library but does not apply kotlin-android. All Android source files are Kotlin (.kt), so without this plugin Gradle never compiles them — the Java-side GeneratedPluginRegistrant then fails to find the class.
11.0.0 (build.gradle):
apply plugin: 'com.android.library'
// ❌ missing: apply plugin: 'kotlin-android'
10.3.10 (build.gradle) — working:
apply plugin: 'com.android.library'
apply plugin: 'org.jetbrains.kotlin.android' // ✅
Steps to Reproduce
- Set
file_picker: 11.0.0 in pubspec.yaml
- Run
flutter clean && flutter pub get
- Run
flutter run targeting an Android device
- Build fails at
:app:compileDebugJavaWithJavac
Downgrading to 10.3.10 resolves the issue immediately.
Environment
- Flutter: 3.41.0 (Dart SDK 3.11.1)
- file_picker: 11.0.0
- AGP: 8.13.0
- Kotlin: 2.2.20
- Gradle: (via Flutter)
- Java: 17
- OS: macOS Darwin 25.4.0
- Device: Samsung SM-M215F (Android, debug mode)
Suggested Fix
Add the missing Kotlin plugin to android/build.gradle:
apply plugin: 'com.android.library'
+ apply plugin: 'org.jetbrains.kotlin.android'
And optionally restore kotlinOptions:
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
Description
Upgrading to
file_picker: 11.0.0causes an Android build failure. TheGeneratedPluginRegistrant.javacannot resolveFilePickerPluginbecause the Kotlin Android plugin is not applied in the package'sandroid/build.gradle.This is the same root cause as the regression in
10.3.9(fixed in10.3.10), but the fix was not carried into the11.0.0release.Related: #1952 (maintainer requested a new issue in this comment)
Error
Root Cause
file_picker 11.0.0'sandroid/build.gradleapplies onlycom.android.librarybut does not applykotlin-android. All Android source files are Kotlin (.kt), so without this plugin Gradle never compiles them — the Java-sideGeneratedPluginRegistrantthen fails to find the class.11.0.0 (
build.gradle):10.3.10 (
build.gradle) — working:Steps to Reproduce
file_picker: 11.0.0inpubspec.yamlflutter clean && flutter pub getflutter runtargeting an Android device:app:compileDebugJavaWithJavacDowngrading to
10.3.10resolves the issue immediately.Environment
Suggested Fix
Add the missing Kotlin plugin to
android/build.gradle:apply plugin: 'com.android.library' + apply plugin: 'org.jetbrains.kotlin.android'And optionally restore
kotlinOptions: