i

    ildar.i [Android]

    2 years ago
    Hi! Had to move method from class to extention and now it throws
    java.lang.IllegalAccessException: Class clean.db.entities.LocalizationDbEntityKt can not access a member of class infin.api.core.legal.entities.auth.login.LocalizationFromServer with modifiers "private final"
    fun LocalizationFromServer.toList() = LocalizationFromServer::class.java.declaredFields.map {
        LocalizationDbEntity(it.name, it.get(this)?.toString())
    }
    Cah anyone help pls?
    r

    ribesg

    2 years ago
    You should be able to call
    it.setAccessible
    in your
    map { }
    before calling
    it.get
    , or something like that
    i

    ildar.i [Android]

    2 years ago
    Thanks, setting
    it.isAccessible = true
    worked!