-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined registrar variable in Java code of file_picker plugin #1647
Comments
Facing same issue, any solution? |
Try running flutter clean, and be careful to delete the .lock file in your project first. Then modify the version number, and finally run flutter pub get again. |
In addition, the last working version I tried was 8.13. |
Back to version 8.13, do not use 8.14 or 8.15. |
You need to specify a specific version, don't use "^",in this way, you will not be automatically upgraded to 8.1.5. |
Duplicate of #1643 And there's no 8.13 or 8.14 or 8.15. There 8.1.3, 8.1.4, 8.1.5 |
Same issue happens with me |
you can use this repo i have fixed the issue https://github.com/rufus-op/file_picker replace file_picker: 8.1.5 with file_picker: |
First of all, Secondly, the issue is: registrar variable is not defined in FilePickerPlugin.java file (version 8.1.5) Therefore, till the issue gets fixed, you can use version 8.1.4. |
Bro, you didn't fork the repo but copied it, and simply overwrote stuff??? rufus-op/file_picker@05992a8#diff-c693279643b8cd5d248172d9c22cb7cf4ed163a3c98c8a3f69c2717edd3eacb7R3 Everything should be just a few lines like it is in #1644 Guys, don't use that code, use the PR code like so: #1643 (comment) |
this helps! |
same issues |
perhaps duplicate #1643 |
Describe the bug
AppData\Local\Pub\Cache\hosted\pub.dev\file_picker-8.1.5\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:257: ����: �Ҳ�������
if (registrar != null) {
^
����: ���� registrar
�: �� FilePickerPlugin
C:\Users\a2911\AppData\Local\Pub\Cache\hosted\pub.dev\file_picker-8.1.5\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:260: ����: �Ҳ�������
registrar.addActivityResultListener(this.delegate);
^
����: ���� registrar
�: �� FilePickerPlugin
2 ������
FAILURE: Build failed with an exception.
Execution failed for task ':file_picker:compileDebugJavaWithJavac'.
BUILD FAILED in 9s
It seems that this error is caused by the use of undefined registrar variable in Java code of file_picker plugin, which leads to compilation failure.
According to the error message, the problem lies in lines 257 and 260 of the' FilePickerPlugin.java' file. The code tries to access a variable named' registrar', but this variable is not defined.
Android 14,
Flutter 3.24.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision dec2ee5c1f (4 weeks ago) • 2024-11-13 11:13:06 -0800
Engine • revision a18df97ca5
Tools • Dart 3.5.4 • DevTools 2.37.3
Similar errors occurred in flutter_file_picker 8.1.5 and 8.1.4.
The text was updated successfully, but these errors were encountered: