/Users/mycomputer/.pub-cache/hosted/pub.dev/file_picker-8.1.5/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:257: error: cannot find symbol
if (registrar != null) {
^
symbol: variable registrar
location: class FilePickerPlugin
/Users/mycomputer/.pub-cache/hosted/pub.dev/file_picker-8.1.5/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:260: error: cannot find symbol
registrar.addActivityResultListener(this.delegate);
^
symbol: variable registrar
location: class FilePickerPlugin
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task
‘:file_picker:compileDebugJavaWithJavac’.
Compilation failed; see the compiler error output for details.
I’m getting the error with file_picker plugin, i have also delete the .gradle file but not getting help. I have also change the file_picker version but not getting help.
Thanks in advanced.
I was facing the same issue.
Go to pubspec.yaml
and change file picker to exact this version :
file_picker: 8.1.4
TECH_ED is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
They just updated their plugin. Download the latest version of file_picker.
I have the same issue, updating file_picker version does not change anything, even with flutter clean && flutter pub get
.
1
The latest update version 8.1.6 (see https://pub.dev/packages/file_picker/changelog#816) to file_picker fixed the issue via https://github.com/miguelpruivo/flutter_file_picker/pull/1644
The PR essentially removes a code section leftover for v1 embedding support. The ticket https://github.com/miguelpruivo/flutter_file_picker/issues/1643 had a ton of duplicates (people don’t check if it’s already reported), and some PR errornously re-introduced imports for the v1 code section to sooth the compiler, instead of yanking the it out. V1 embedding is gone for a good while now.
Temporary fix until this new version was to use the PR’s branch:
file_picker:
git:
url: https://github.com/abdelaziz-mahdy/flutter_file_picker
ref: fix-flutter-3.27-compile-error
(with or without a dependency_overrides
, taste differs)
Apparently another PR probably accidentally brought those v1 embedding code remnants.