Fixed
Status Update
Comments
yb...@google.com <yb...@google.com> #2
The error is happening when try to run the tests in `data_room` module.
yb...@google.com <yb...@google.com> #3
seems like an error in the method writer since it should be marking all parameters final.
za...@gmail.com <za...@gmail.com> #4
Facing the same issue
za...@gmail.com <za...@gmail.com> #5
Fix in progress.
Meanwhile, targeting Java8 will fix this.
Meanwhile, targeting Java8 will fix this.
yb...@google.com <yb...@google.com>
da...@google.com <da...@google.com> #6
Thanks! The workaround worked for me ;)
android {
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
...
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
android {
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
...
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
Description
Version used: 1.1.0-present
Theme used: NA
Devices/Android versions reproduced on: NA build-time
- Relevant code to trigger the issue: Any kotlin data class in an external module. Building the following project can reproduce it:
In Kotlin, data classes will have a primary constructor and sometimes generated synthetic constructors. ROOM's processor will complain about the presence of the synthetic ones (which are usually visible when reading the class file from an external library), but since it's reading metadata it could use it to find the "primary" constructor to know for sure.
Example:
The solution would be to find that constructor, then match it to the corresponding constructor as seen in the elements API