如何解决我的Flutter应用程序的错误消息

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

How do I resolve the error messages for my flutter app

问题

我正在开发一个应用程序,该应用程序由著名的YouTube频道Codepur完成。我尝试构建音乐播放器应用程序,我在依赖项中使用了'flute_music_player:'。但是在开发过程中出现了问题。控制台消息如下:

插件flute_music_player使用了Android嵌入的已弃用版本。
为避免意外的运行时故障或未来的构建故障,请尝试查看此插件是否支持Android V2嵌入。否则,请考虑删除它,因为Flutter的未来版本将删除这些已弃用的API。
如果您是插件作者,请参阅迁移插件到V2嵌入的文档:https://flutter.dev/go/android-plugin-migration。
在调试模式下启动lib\main.dart上的Chrome...
错误:由于以下依赖关系不支持空安全,因此无法运行,声音为空安全:

  • package:flute_music_player

有关解决方案,请参见https://dart.dev/go/unsound-null-safety

未处理的异常:
不支持空安全模式NonNullableByDefaultCompiledMode.Invalid的坏状态,在空处。
#0 ProgramCompiler.emitModule(package:dev_compiler/src/kernel/compiler.dart:511:9)

#1 IncrementalJavaScriptBundler.compile(package:frontend_server/src/javascript_bundle.dart:214:33)

#2 FrontendCompiler.writeJavascriptBundle(package:frontend_server/frontend_server.dart:721:46)
<异步悬停>
#3 FrontendCompiler.compile(package:frontend_server/frontend_server.dart:614:9)
<异步悬停>

#4 listenAndCompile.<匿名闭包>(package:frontend_server/frontend_server.dart:1222:11)
<异步悬停>

Dart编译器意外退出。
无法编译应用程序。
已退出(sigterm)
*

如果需要更多信息,请访问应用程序的源代码和插件:https://github.com/iampawan/Flutter-Music-Player 或查看他的YouTube视频:https://www.youtube.com/watch?v=eWicXD5vkyg&list=PLR2qQy0Zxs_UdqAcaipPR3CG1Ly57UlhV&index=25

我是stackoverflow的新手,所以您可以在提问时指出错误。

我尝试按照ChatGPT上提到的方法来做事情,但很难理解。

英文:

I am building app which is done by famous youtube channel-Codepur. I was trying to build music player app, I used 'flute_music_player:' in dependency. But issues are comming in the way. The console message is:

*
The plugin flute_music_player uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Launching lib\main.dart on Chrome in debug mode...
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

  • package:flute_music_player

For solutions, see https://dart.dev/go/unsound-null-safety

Unhandled exception:
Bad state: Unsupported Null Safety mode NonNullableByDefaultCompiledMode.Invalid, in null.
#0 ProgramCompiler.emitModule (package:dev_compiler/src/kernel/compiler.dart:511:9)

#1 IncrementalJavaScriptBundler.compile (package:frontend_server/src/javascript_bundle.dart:214:33)
#2 FrontendCompiler.writeJavascriptBundle (package:frontend_server/frontend_server.dart:721:46)
<asynchronous suspension>
#3 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:614:9)
<asynchronous suspension>

#4 listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1222:11)
<asynchronous suspension>

the Dart compiler exited unexpectedly.
Failed to compile application.
Exited (sigterm)
*

If needed more info, head to app's source code and plugins : https://github.com/iampawan/Flutter-Music-Player or his yt video: https://www.youtube.com/watch?v=eWicXD5vkyg&amp;list=PLR2qQy0Zxs_UdqAcaipPR3CG1Ly57UlhV&amp;index=25

I am new to stackoverflow, so you can point out mistakes while asking question.

I tried to do things mentioned on ChatGPT but it's quite hard to understand those.

答案1

得分: 2

这个包已经五年没有更新了,不兼容当前版本的Dart和Flutter。

你需要要么找一个正在维护的不同的包来使用,要么分叉(fork)这个包并自己更新它(在Dart端添加null安全性,更新原生Android代码中的插件API,以及可能的其他更改)。

英文:

That package hasn't been updated in five years, and is not compatible with current versions of Dart and Flutter.

You will need to either find a different package to use that is being maintained, or fork that package and update it yourself (adding null safety on the Dart side, updating the plugin APIs in the native Android code, and potentially other changes as well).

huangapple
  • 本文由 发表于 2023年8月10日 19:28:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/76875303.html
匿名

发表评论

匿名网友

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

确定