Kotlin中使用Dagger2 可能导致错误"Dagger does not support injection into private fields"
Kotlin生成.java文件时属性变成了private,给属性添加@JvmField声明可以转成public
class User {
var name:String ? = null
val age: Int = 20
}
class User2 {
@JvmField
var name:String ? = null
val age: Int
原创
2017-07-27 17:43:08 ·
3228 阅读 ·
1 评论