【问题标题】: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

【问题讨论】:

    标签: flutter gradle dart


    【解决方案1】:

    我遇到了同样的错误,我通过将相机包(https://pub.dev/packages/camera)更新到版本 ^0.5.8+8 来修复它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-26
      • 1970-01-01
      • 2015-06-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-15
      • 2022-07-04
      • 2019-04-05
      相关资源
      最近更新 更多