You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter中file_picker插件编译失败问题求助

file_picker插件编译失败问题求助

使用file_picker插件时遭遇编译失败,具体报错信息如下:

/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.

已尝试以下操作但问题未解决:

  • 删除.gradle文件
  • 更换file_picker版本

恳请技术支持。


内容的提问来源于stack exchange,提问作者Alpit Panchal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 11:35:59