I'm using Android studio 4.1.1, ObjectBox 3.0.1 and Kotlin 1.5.10.
The tests run nicely when I hit the run button on the test class or run ./gradlew :app-core:test
, but when I click on Run X with coverage
the tests run through, I'm shown
Project Is out of Date: Project class files are out of date. Would you like to recompile? The refusal to do it will result in incomplete coverage information
If I click on Cancel
the coverage report in the background disappears (so I can't read the coverage info, also there is no coverage info left of the code lines in the editor).
If I click OK
compilation is started and I get a compilation error in a ObjectBox-generated file SomeEntityCursor
:
Error:(14, 49) java: cannot find symbol
symbol: class SomeEntity
The same is happening in other generated classes (see details below). But bottom line is that the generated code seems to not be able to see my entity class. Noteworthy: the generated code is in the same module as the entity class.
Fyi, SomeEntity
simply looks like this:
@Entity
data class SomeEntity(@Id var id: Long = 0, ...)
Strangely, sometimes it manages to compile, but certainly not if I do a Clean project
before!
Here is the full output (I'm sorry for the inconsistencies between example package names and the ones in the log, I hope it doesn't make any difference!):
Information:Kotlin: kotlinc-jvm 1.4.32 (JRE 1.8.0_242-release-1644-b3-6915495)
Information:java: Errors occurred while compiling module 'SomeApp.common.common-android'
Information:javac 1.8.0_242-release was used to compile java sources
Information:11/8/21 2:46 PM - Build completed with 21 errors and 3 warnings in 8 s 772 ms
/Users/xxx/Documents/Programming/SomeApp/common/common-android/build/generated/source/kapt/debug/com/somecompany/someapp/common/android/persistence/SomeEntityCursor.java
Error:Error:line (14)java: cannot find symbol
symbol: class SomeEntity
Error:Error:line (34)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntityCursor
Error:Error:line (44)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntityCursor
Error:Error:line (16)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntityCursor
Error:Error:line (18)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntityCursor.Factory
/Users/xxx/Documents/Programming/SomeApp/common/common-android/build/generated/source/kapt/debug/com/somecompany/someapp/common/android/persistence/SomeEntity_.java
Error:Error:line (15)java: cannot find symbol
symbol: class SomeEntity
Error:Error:line (93)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_
Error:Error:line (23)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_
Error:Error:line (27)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_
Error:Error:line (34)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_
Error:Error:line (37)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_
Error:Error:line (40)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_
Error:Error:line (44)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_
Error:Error:line (50)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_
Error:Error:line (63)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_
Error:Error:line (73)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_
Error:Error:line (78)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_
Error:Error:line (83)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_
Error:Error:line (88)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_
Error:Error:line (95)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_.SomeEntityIdGetter
Error:Error:line (23)java: cannot find symbol
symbol: class SomeEntity
location: class com.comecompany.someapp.common.android.persistence.SomeEntity_
I couldn't find any info info on the problem on the web, unfortunately, so any hint is appreciated, thanks!
app
module (including all other modules) is added. I have it on GitHub (privately, I can give you access if you want). There are two commits, one where it works and one where it doesn't anymore @Uwe-ObjectBox – Triatomic