Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kapt build error after update from realm 7.0.8 to 10.1.0 #7213

Closed
kzotin opened this issue Nov 19, 2020 · 7 comments
Closed

Kapt build error after update from realm 7.0.8 to 10.1.0 #7213

kzotin opened this issue Nov 19, 2020 · 7 comments
Assignees

Comments

@kzotin
Copy link

kzotin commented Nov 19, 2020

Goal

Hi,
I'd like to report an issue we're facing after updating realm-java to 10.0.1

Actual Results

Build fails for multi-module setup: realm models from base module can't be seen in intermediate-layer module during kapt phase:

> Task :intermediate:kaptDebugKotlin FAILED
e: [kapt] An exception occurred: java.lang.IllegalArgumentException: Class com.example.base.Location was not found
	at io.realm.processor.ClassCollection.getClassFromQualifiedName-omp8SrQ(ClassCollection.kt:40)
	at io.realm.processor.RealmProxyClassGenerator.emitRealmModel(RealmProxyClassGenerator.kt:373)
	at io.realm.processor.RealmProxyClassGenerator.emitPersistedFieldAccessors(RealmProxyClassGenerator.kt:242)
	at io.realm.processor.RealmProxyClassGenerator.generate(RealmProxyClassGenerator.kt:92)
	at io.realm.processor.RealmProcessor.createProxyClassFiles(RealmProcessor.kt:279)
	at io.realm.processor.RealmProcessor.process(RealmProcessor.kt:193)
...

Our real setup is quite complex (60+ interdependent modules), but I succeeded to reproduce the issue in the simple project.

Steps & Code to Reproduce

Build (gradlew clean assembleDebug) following repository:
https://github.com/kzotin/RealmBug

Build log:
https://github.com/kzotin/RealmBug/blob/main/assemble-10.0.1.log

If you roll back realm version to 7.0.8 in build.gradle, the project is built successfully.

Version of Realm and tooling

Realm version(s): 10.0.1

Realm Sync feature enabled: No

Android Studio version: 4.1.1

Android Build Tools version: 29.0.2

Gradle version: 6.7

@kzotin kzotin changed the title Kapt build error after update from realm v7 to 10.0.1 Kapt build error after update from realm 7.0.8 to 10.0.1 Nov 19, 2020
@nhachicha
Copy link
Collaborator

Hi @kzotin Thanks for the repro project. Just double checking do you still experience this issue with the 10.1.0 release?

@nhachicha nhachicha self-assigned this Nov 24, 2020
@kzotin
Copy link
Author

kzotin commented Nov 25, 2020

Thanks, haven't noticed the update.

Issue is still reproduced with 10.1.0, updated project and build log:
https://github.com/kzotin/RealmBug/blob/main/assemble-10.1.0.log

Please also note that after failed build kapt locks build directory and clean can't be done second time (reproduced consistently).
If you run build second time you see following:
https://github.com/kzotin/RealmBug/blob/main/assemble-10.1.0-repeat.log

@kzotin kzotin changed the title Kapt build error after update from realm 7.0.8 to 10.0.1 Kapt build error after update from realm 7.0.8 to 10.1.0 Nov 25, 2020
nhachicha added a commit that referenced this issue Nov 27, 2020
@nhachicha
Copy link
Collaborator

Hi @kzotin I just released 10.1.1 this should fix the issue, could you give it a try, please?

@kzotin
Copy link
Author

kzotin commented Dec 1, 2020

Hi @nhachicha,
It fixed the current sample project but doesn't fix our production app.

Succeeded to isolate the case - it happens when you add RealmList <YourModel> .
Sample project was updated.

nhachicha added a commit that referenced this issue Dec 2, 2020
nhachicha added a commit that referenced this issue Dec 2, 2020
@nhachicha
Copy link
Collaborator

Hi @kzotin can you try the new Snapshot release 10.1.2-SNAPSHOT if it works I'll do a release shortly with the fix
Don't forget to add the OJO repo bellow

maven {
            url 'http://oss.jfrog.org/artifactory/oss-snapshot-local'
        }

https://github.com/realm/realm-java#using-snapshots

@kzotin
Copy link
Author

kzotin commented Dec 2, 2020

@nhachicha works well for our production app, thank you!
BUILD SUCCESSFUL

@nhachicha
Copy link
Collaborator

@kzotin 10.1.2 is released.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants