android - Dagger2 @Binds methods' parameter type must be assignable to the return type with interface and implementation
问题描述
解决方案
我怀疑这可能是“缺少”@JvmSuppressWildcards 的情况,其中 kotlin? extends String
在List
类型中添加了一些,这使得 dagger 编译器失败(错误消息应该包含更多提示)。
我想您需要将函数类型更改为Function<List<@JvmSuppressWildcards String>, String>
使用它的位置。
这是一个已知的烦恼,您可以在此处阅读更多详细信息: https ://medium.com/@naturalwarren/dagger-kotlin-3b03c8dd6e9b
我怀疑这MutableList
不存在这个问题,因为您可以使用它“读取”和“写入”字符串。
推荐阅读
- c# - 网页旨在返回基于答案的数字,但只返回空值?
- eloquent - 如何在 Eloquent 中为 A 和( B 或 C )创建查询
- css - 分页:如何使其响应
- java - Kubernetes pod FileLockException:锁定文件已被另一个进程锁定-neo4j 4.2
- xcode - Xcode 12.5 - 如何放大编辑器字体?
- java - 如何使用 Fragment 创建收藏按钮?
- node.js - 如何在 Mac M1 芯片组上安装带有 NVM 的旧版本 Node.js
- python - 如何使用 Outlook API 获取特定 Outlook 电子邮件的电子邮件
- flutter - 不能无条件访问属性“数量”,因为接收者可以为“空”。尝试使访问有条件(使用'?.')
- python - 如何在 numpy 结构化数组中设置多种类型?