Skip to content

[BUG] Triggers java.lang.IllegalStateException: Will be generated in Android #129

@ivanovpv

Description

@ivanovpv

Describe the bug
Works well under JVM, but with Android it doesn't work

To Reproduce
Simplest Android unit test fails

import org.junit.runner.RunWith
import org.junit.Test
import tech.mappie.api.ObjectMappie

@RunWith(AndroidJUnit4::class)
class MapperTest {

    @Test
    fun testClassic() {
        val person = Person("John", "Doe", 99)
        val dto = PersonToPersonDtoMapper.map(person) //raises java.lang.IllegalStateException: Will be generated
        println("dto = $dto")
    }
}

object PersonToPersonDtoMapper : ObjectMappie<Person, PersonDto>() {
    override fun map(from: Person) = mapping {
        to::name fromValue "${from.name} ${to.name}"
    }
}

data class Person(
    val name: String,
    val surname: String,
    val age: Int,
)

data class PersonDto(
    val name: String,
    val age: Int,
)

Expected behavior
Expected translation from domain to dto bean

Additional context
Kotlin = 2.0.20
Android API = 34
mappieApi = "0.9.0" ("0.8.0" - the same behaviour)
For sure mappie plugin/dependencies are included.

Sources to reproduce bug: https://github.com/ivanovpv/TestApplication

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions