[英]Error when include path_provider
I get an error when I'm trying to compile path_provider: 我在尝试编译path_provider时遇到错误:
/home/user/projects/flutterframework/TestApp/android/app/src/main/java/io/flutter/plugins/PluginRegistry.java:15: /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); path_provider = PathProviderPlugin.register(activity);
symbol: method register(FlutterActivity) 符号:方法寄存器(FlutterActivity)
location: class PathProviderPlugin location:类PathProviderPlugin
1 error 1错误
FAILURE: Build failed with an exception. FAILURE:构建因异常而失败。
What went wrong: 什么地方出了错:
Execution failed for task ':app:compileDebugJavaWithJavac'. 任务':app:compileDebugJavaWithJavac'的执行失败。
Compilation failed; 编译失败; see the compiler error output for details. 请参阅编译器错误输出以获取详细信
How can I fix it? 我该如何解决? Lubuntu 16 LTS x64 Lubuntu 16 LTS x64
It sounds like you have an old project template. 听起来你有一个旧的项目模板。 You shouldn't have a PluginRegistry.java. 你不应该有PluginRegistry.java。 Try flutter upgrade, recreate your project and copy the old project's dart files and assets over. 尝试flutter升级,重新创建项目并复制旧项目的dart文件和资产。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.