一些输入文件使用或覆盖了已弃用的 API:Flutter 构建 Android

huangapple go评论81阅读模式
英文:

Some input files use or override a deprecated API Flutter build android

问题

我有一个Flutter项目,我想在Android Studio中构建它。我在终端中使用以下命令构建它:

flutter build apk --release

我收到了这个错误报告:

注意:C:\Users\Jovik\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\path_provider-1.5.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java使用或覆盖了已弃用的API。
注意:重新编译时请使用 -Xlint:deprecation 以获取详细信息。
注意:一些输入文件使用或覆盖了已弃用的API。
注意:重新编译时请使用 -Xlint:deprecation 以获取详细信息。
注意:一些输入文件使用了未经检查或不安全的操作。
注意:重新编译时请使用 -Xlint:unchecked 以获取详细信息。
注意:一些输入文件使用了未经检查或不安全的操作。
注意:重新编译时请使用 -Xlint:unchecked 以获取详细信息。
C:\Users\Jovik\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\shared_preferences-0.5.6\android\src\main\java\io\flutter\plugins\sharedpreferences\SharedPreferencesPlugin.java:25: 警告:[已弃用] FlutterPluginBinding 中的 getFlutterEngine() 方法已弃用
    setupChannel(binding.getFlutterEngine().getDartExecutor(), binding.getApplicationContext());

我不是Flutter开发者,因此对这些技术没有特殊的了解。我已经升级了Flutter,而且Flutter Doctor没有发现任何错误,问题是什么?你能帮助我吗?请给出关于我做错了什么的建议。

英文:

I have a flutter project and I want to build it in android studio. I build it with this command in the terminal:

flutter build apk --release

I'm getting this error report:

Note: C:\Users\Jovik\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\path_provider-1.5.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java uses or overrides
 a deprecated API.
Note: Recompile with -Xlint: deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint: deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint: unchecked for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint: unchecked for details.
C:\Users\Jovik\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\shared_preferences-0.5.6\android\src\main\java\io\flutter\plugins\sharedpreferences\SharedPreferencesPlugin.java:25: warn
ing: [deprecation] getFlutterEngine() in FlutterPluginBinding has been deprecated
    setupChannel(binding.getFlutterEngine().getDartExecutor(), binding.getApplicationContext());

I'm not a flutter developer so I have no special knowledge of these technologies. I have upgraded flutter and the flutter doctor did not find any error what problem? Could you help me too? Give advice on what I’m doing wrong.

答案1

得分: 6

这是与Flutter中的shared_preferences插件相关的已知问题。该问题在大约20天前得到了解决。请确保您正在使用最新版本的shared_preferences(0.5.6+3),并在您的pubspec.yaml中进行更新以反映这一点。

英文:

This is a known issue with the shared_preferences plugin with flutter. This issue has been addressed about 20 days ago. Make sure that you are using the newest version of shared_preferences (0.5.6+3) and update to reflect this in your pubspec.yaml.

huangapple
  • 本文由 发表于 2020年4月3日 21:16:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/61012781.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定