Flutter 任务':file_picker:compileDebugJavaWithJavac'执行失败

问题描述 投票:0回答:1

enter image description here

/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:构建失败并出现异常。

* What went wrong:
Execution failed for task 

':file_picker:compileDebugJavaWithJavac'。

编译失败;有关详细信息,请参阅编译器错误输出。

我收到 file_picker 插件的错误,我还删除了 .gradle 文件,但没有获得帮助。我还更改了 file_picker 版本,但没有获得帮助。

提前致谢。

flutter dart dart-pub filepicker
1个回答
0
投票

我也面临着同样的问题。 前往

pubspec.yaml

并更改文件选择器以精确此版本:

file_picker: 8.1.4
© www.soinside.com 2019 - 2024. All rights reserved.