This message was deleted.
# caching
s
This message was deleted.
d
Colleagues recommended to tag you, Nelson @no :)
n
Are you using hilt?
d
No, i saw the issue that was fixed with 2.7.0
n
Oh. you mean it was fixed with the Android Cache Fix plugin 2.7.0?
d
nope, sorry for confusion I mean we're not using Hilt, that's all
I saw some issue regarding Hilt in Cache fix issue tracker
n
can you try with Android Cache fix plugin 2.7.0? cc @Inaki Villar @Inaki
d
If only I had a reproducer... I already made a PR with 2.7.0, but dont' know how to say for sure if it helped, because that's only occasional issue, only some builds have this problem
n
Yeah, it looks quite similar which is why I thought it was that.
i
Hi Dmitry, I was trying to reproduce the issue locally without success. The room workaround output directory is based on the android variants of the project where the plugin is applied. The expectation is they are always unique. I would like to ask you some questions to have a better understanding: • Java Version • Kotlin Version • Is room applied to more than one module? • Are other Kapt/apt processors used in the same module using room? • Are you using Databinding? • How are you configuring the room "$projectDir/schemas" property? • Are there eager calls for JavaCompile/KaptWithoutKotlincTask tasks in the module and/or project? • Do you have kapt specific configurations copying compiler arguments? • When you have a build with this issue, can we verify which other tasks are executed in the same module? thanks
d
Hey, i had no success either. That's the information you asked: • java 11 used for build • kotlin 1.7.21 • room applied to multiple modules • Yes, up to 3 i guess, there are dagger, room and some custom annotation processor can be used in single module • schemas property configuration
Copy code
private fun applyCacheMissesWorkaround(project: Project) {
        val schemasDir = project.layout.projectDirectory.dir("roomSchemas")
        project.extensions.configure<RoomExtension>("room") {
            it.schemaLocationDir.set(schemasDir)
        }

        project.plugins.whenAndroidPluginApplied {
            project.testedExtension { tests ->
                tests.sourceSets.getByName("test") { testsSourceSet ->
                    testsSourceSet.assets.srcDirs(schemasDir)
                }
                tests.testOptions.unitTests.isIncludeAndroidResources = true
            }
        }
    }
• no eager calls, only default wiring by plugins (i probably need to doublecheck that) • room convention
Copy code
project.kaptExtension {
                it.arguments {
                    arg("room.incremental", "true")
                }
            }
kapt convention
Copy code
project.kaptExtension {
                it.useBuildCache = true
                // By default, kapt replaces every unknown type (including types for the generated classes) to NonExistentClass
                // that can lead to hard to diagnose errors
                it.correctErrorTypes = true
                // include the original locations in the Kotlin files into error reports
                it.mapDiagnosticLocations = true

                it.javacOptions {
                    // Increase the max count of errors from annotation processors.
                    // Helps when N-th (and the most important) cause is buried beneath tons of errors
                    // Default is 100.
                    option("-Xmaxerrs", 10000)
                }
            }
• i am trying to provide you with build scan dump, hope will do it today, problem with timeouts on downloading
👌 1
i
Thank you for the answers Dmitry, I tried to replicate your configuration in my sample project. Of all the different tests I was able to reproduced only once. The bad news is that after I saw the error I was not able to reproduce it again, checking my build history the sequence was: 1- Execute in command line for one module using room a task like:
clean :core:database:test
2- Move to AS and sync the project 3- Execute in the IDE the test source for the same module: Result: https://ge.solutions-team.gradle.com/s/buphjazzfdqcc/timeline?details=rokr3tcj3n4pk again, I was not able to reproduce the issue following the same steps. I'll continue tomorrow with the investigation
d
Thank you so much! It's very rare occasion in our builds too If you can think of any way i can help you more - please let me know, i will try to gather more data (still trying to get a scan dump)
i
Hi Dmitriy, bringing up this issue again. After our investigation, we noticed that the issue showed when there was a change in the AGP version without cleaning the outputs of the project. The good news is that we are not seeing this issue when we switch versions over AGP >= 7.4.1. The list of combinations tested was: • 7.3.1 -> 7.4.1 - Overlapping • 7.4.1 -> 7.3.1 - Overlapping • 7.4.1 -> 7.4.2 - No Overlapping • 7.4.2 -> 7.4.1 - No Overlapping • 7.4.2 -> 8.0.0 - No Overlapping • 8.0.0 -> 7.4.2 - No Overlapping
we assume that you're not experiencing this issue with newer AGP versions, can you confirm that please?
👌 1
d
Hey, I can't see this problem after some time after migration to 7.4.x either Thank you!
👌 1