本文介绍了任务':音频播放器:编译调试Kotlin'的颤动执行失败;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试安装了audioplayers: ^0.17.1并运行了我的颤动项目。它抛出以下错误。有人能帮帮忙吗?

e: C:UsersUserflutter.pub-cachehostedpub.dartlang.orgaudioplayers-0.17.1androidsrcmainkotlinxyzluanaudioplayersAudioplayersPlugin.kt: (181, 52): Expecting a parameter declaration
e: C:UsersUserflutter.pub-cachehostedpub.dartlang.orgaudioplayers-0.17.1androidsrcmainkotlinxyzluanaudioplayersAudioplayersPlugin.kt: (231, 38): Expecting an argument
e: C:UsersUserflutter.pub-cachehostedpub.dartlang.orgaudioplayers-0.17.1androidsrcmainkotlinxyzluanaudioplayersByteDataSource.kt: (8, 37): Expecting a parameter declaration
e: C:UsersUserflutter.pub-cachehostedpub.dartlang.orgaudioplayers-0.17.1androidsrcmainkotlinxyzluanaudioplayersWrappedMediaPlayer.kt: (10, 39): Expecting a parameter declaration
e: C:UsersUserflutter.pub-cachehostedpub.dartlang.orgaudioplayers-0.17.1androidsrcmainkotlinxyzluanaudioplayersWrappedSoundPool.kt: (168, 32): Expecting a parameter declaration
e: C:UsersUserflutter.pub-cachehostedpub.dartlang.orgaudioplayers-0.17.1androidsrcmainkotlinxyzluanaudioplayersWrappedSoundPool.kt: (205, 26): Expecting an argument
e: C:UsersUserflutter.pub-cachehostedpub.dartlang.orgaudioplayers-0.17.1androidsrcmainkotlinxyzluanaudioplayersWrappedSoundPool.kt: (46, 77): Type inference failed. Expected type mismatch: inferred type is List<???> but MutableList<WrappedSoundPool> was expected

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':audioplayers:compileDebugKotlin'.
> Compilation error. See log for more 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 37s
Exception: Gradle task assembleDebug failed with exit code 1

推荐答案

我从早上开始就一直在努力解决这个问题,最后有两个修复方法:

升级到Ffltter 2.0,然后在pubspec.yaml

中将音频播放器依赖更新到0.19.0

*在build.gradle中将ext.kotlin_Version更改为‘1.4.32’

如果由于某些原因您不想升级到Ffltter 2.0,则将您的音频播放器依赖项降级为^0.16.0。

注意:若要更新颤动SDK,请使用flutter upgrade命令。

这篇关于任务&#39;:音频播放器:编译调试Kotlin&#39;的颤动执行失败;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 01:47