包含 path_provider 时出错

Error when include path_provider

我在尝试编译时遇到错误 path_provider:

/home/user/projects/flutterframework/TestApp/android/app/src/main/java/io/flutter/plugins/PluginRegistry.java:15:

error: cannot find symbol

path_provider = PathProviderPlugin.register(activity);

symbol: method register(FlutterActivity)

location: class PathProviderPlugin

1 error

FAILURE: Build failed with an exception.

What went wrong:

Execution failed for task ':app:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

我该如何解决? Lubuntu 16 LTS x64

听起来你有一个旧的项目模板。你不应该有 PluginRegistry.java。尝试 flutter upgrade,重新创建项目并将旧项目的 dart 文件和资产复制过来。