构建我的应用程序时出现不推荐使用的错误
Posted
技术标签:
【中文标题】构建我的应用程序时出现不推荐使用的错误【英文标题】:I am getting deprecated error when building my apps 【发布时间】:2021-01-25 14:01:50 【问题描述】:我正在尝试构建我的应用程序,但它一直向我显示这些错误,我不知道该怎么做。请阅读以下内容:
E:\flutter\.pub-cache\hosted\pub.dartlang.org\share-0.6.5+1\android\src\main\java\io\flutter\plugins\share\SharePlugin.java:14: warning: [deprecation] PluginRegistry in io.flutter.plugin.common has been deprecated
import io.flutter.plugin.common.PluginRegistry.Registrar;
^
E:\flutter\.pub-cache\hosted\pub.dartlang.org\share-0.6.5+1\android\src\main\java\io\flutter\plugins\share\SharePlugin.java:14: warning: [deprecation] PluginRegistry in io.flutter.plugin.common has been deprecated
import io.flutter.plugin.common.PluginRegistry.Registrar;
^
error: warnings found and -Werror specified
1 error
2 warnings
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':share:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2m 36s
Exception: Gradle task assembleDebug failed with exit code 1
【问题讨论】:
【参考方案1】:我遇到了同样的错误,我通过将相机包(https://pub.dev/packages/camera)更新到版本 ^0.5.8+8 来修复它。
【讨论】:
以上是关于构建我的应用程序时出现不推荐使用的错误的主要内容,如果未能解决你的问题,请参考以下文章
通过Rails中的关联使用has_many创建新模型时出现不允许的参数错误
codeblocks调试时出现不支持16位应用程序的提示,但编译时没有出现错误?